error handling up to client
This commit is contained in:
parent
f7a66920e0
commit
c50e17c555
2 changed files with 16 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue