Commit 2ef6e50b authored by Administrator's avatar Administrator
Browse files

Fix generating etherpad links

/close #63
parent 8b11e3a5
...@@ -226,15 +226,13 @@ class Protocol(DatabaseModel): ...@@ -226,15 +226,13 @@ class Protocol(DatabaseModel):
return "Protokoll:{}-{:%Y-%m-%d}".format(self.protocoltype.short_name, self.date) return "Protokoll:{}-{:%Y-%m-%d}".format(self.protocoltype.short_name, self.date)
def get_etherpad_link(self): def get_etherpad_link(self):
print(self.pad_identifier) if self.pad_identifier is None:
if self.pad_identifier is not None: identifier = self.get_identifier()
return self.pad_identifier if self.protocoltype.non_reproducible_pad_links:
identifier = self.get_identifier() identifier = "{}-{}".format(identifier, str(uuid4()))
if self.protocoltype.non_reproducible_pad_links: self.pad_identifier = identifier
identifier = "{}-{}".format(identifier, str(uuid4())) db.session.commit()
self.pad_identifier = identifier return get_etherpad_url(self.pad_identifier)
db.session.commit()
return get_etherpad_url(identifier)
def get_datetime(self): def get_datetime(self):
return datetime(self.date.year, self.date.month, self.date.day, self.protocoltype.usual_time.hour, self.protocoltype.usual_time.minute) return datetime(self.date.year, self.date.month, self.date.day, self.protocoltype.usual_time.hour, self.protocoltype.usual_time.minute)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment