1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

error handling up to client

This commit is contained in:
Pierre-antoine Comby
2020-03-26 23:05:37 +01:00
parent f7a66920e0
commit c50e17c555
2 changed files with 16 additions and 3 deletions

View File

@ -249,5 +249,5 @@ class Alias(models.Model):
def delete(self, using=None, keep_parents=False):
if self.name == str(self.note):
raise ValidationError(_("You can't delete your main alias."),
code="cant_delete_main_alias")
code="main_alias")
return super().delete(using, keep_parents)