add etherpad-check to clean method

This commit is contained in:
2022-03-17 13:49:16 +00:00
parent 3de17b3e8d
commit c2fedabada

View File

@@ -164,10 +164,11 @@ class Etherpad(models.Model):
params={"length": len(pad_name), "pad_name": pad_name},
)
def save(self, *args, **kwargs):
self.etherpad_key = create_pad(self.__get_pad_name())
super().save(*args, **kwargs)
self.etherpad_key = create_pad(pad_name)
if not self.etherpad_key:
raise ValidationError(
_(f"Etherpad '{pad_name}' konnte nicht erstellt werden."),
)
def __str__(self):
return self.title