1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00

fix clean on edit

This commit is contained in:
Lukas Winkler 2020-06-14 16:21:39 +02:00
parent 77012ee325
commit c0d5b61932
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -43,6 +43,7 @@ class Acronym(models.Model):
ordering = ["name"]
def clean(self):
if not self.id:
new_slug = slugify(self.name)
try:
found = Acronym.objects.get(slug=new_slug)