create pad rework
This commit is contained in:
@@ -82,9 +82,12 @@ def create_pad(padID, text="helloworld"):
|
||||
|
||||
epc.createGroupPad(groupID=group["groupID"], padName=padID, text=text)
|
||||
logger.info(f"neues Pad erzeugt: {padID}")
|
||||
|
||||
return padID
|
||||
|
||||
return None
|
||||
if __pad_exists(padID=padID):
|
||||
return padID
|
||||
else:
|
||||
raise Exception("Tried to create pad but failed!")
|
||||
|
||||
|
||||
def get_pad_html(padID):
|
||||
|
||||
@@ -172,8 +172,9 @@ class Etherpad(models.Model):
|
||||
|
||||
if self.etherpad_key is None:
|
||||
self.etherpad_key = create_pad(pad_name)
|
||||
if self.etherpad_key is None:
|
||||
raise ValidationError(f"Etherpad '{pad_name}' konnte nicht erstellt werden.")
|
||||
|
||||
if self.etherpad_key is None:
|
||||
raise ValidationError(f"Etherpad '{pad_name}' konnte nicht erstellt werden. This should never happen!")
|
||||
|
||||
@property
|
||||
def etherpad_html(self):
|
||||
|
||||
Reference in New Issue
Block a user