Skip to content
Snippets Groups Projects
Commit 59cbe00a authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Limit length of etherpad urls

/close #45
parent 12015614
No related branches found
No related tags found
No related merge requests found
...@@ -244,7 +244,7 @@ class Protocol(DatabaseModel): ...@@ -244,7 +244,7 @@ class Protocol(DatabaseModel):
if self.pad_identifier is None: if self.pad_identifier is None:
identifier = self.get_identifier() identifier = self.get_identifier()
if self.protocoltype.non_reproducible_pad_links: if self.protocoltype.non_reproducible_pad_links:
identifier = "{}-{}".format(identifier, str(uuid4())) identifier = "{}-{}".format(identifier, str(uuid4()).replace("-", ""))[:50]
self.pad_identifier = identifier self.pad_identifier = identifier
db.session.commit() db.session.commit()
return get_etherpad_url(self.pad_identifier) return get_etherpad_url(self.pad_identifier)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment