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:
parent
77012ee325
commit
c0d5b61932
1 changed files with 8 additions and 7 deletions
|
@ -43,6 +43,7 @@ class Acronym(models.Model):
|
||||||
ordering = ["name"]
|
ordering = ["name"]
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
if not self.id:
|
||||||
new_slug = slugify(self.name)
|
new_slug = slugify(self.name)
|
||||||
try:
|
try:
|
||||||
found = Acronym.objects.get(slug=new_slug)
|
found = Acronym.objects.get(slug=new_slug)
|
||||||
|
|
Loading…
Reference in a new issue