radiac / django-tagulous

Fabulous Tagging for Django
http://radiac.net/projects/django-tagulous/
Other
336 stars 66 forks source link

Duplicate slug incrementing error #152

Closed radiac closed 2 years ago

radiac commented 2 years ago

Discussed in https://github.com/radiac/django-tagulous/discussions/146

Originally posted by **37b** October 22, 2021 I am using tagulous indirectly as a user of [Defect Dojo](https://github.com/DefectDojo/django-DefectDojo) and I am having a problem. I have multiple tags that all begin with the same _n_ characters which get truncated to something like this for the slug `urnasset1234content-definition-testcycle-managemen` `urnasset1234content-definition-testcycle-mana_1` `urnasset1234content-definition-testcycle-mana_2` `urnasset1234content-definition-testcycle-mana_3` `urnasset1234content-definition-testcycle-mana_4` `urnasset1234content-definition-testcycle-mana_5` `urnasset1234content-definition-testcycle-mana_6` `urnasset1514content-definition-testcycle-mana_7` `urnasset1514content-definition-testcycle-mana_8` `urnasset1514content-definition-testcycle-mana_9` `urnasset1514content-definition-testcycle-mana_10` However, once I hit `_10` the app no longer increments and instead throws an exception `django.db.utils.IntegrityError: (1062, "Duplicate entry 'urnasset1514content-definition-lifecycle-mana_10' for key 'dojo_tagulous_engagement_tags_slug_53c6df0a_uniq'` Is there a way to increase this number of increments? If not, can I at least lengthen the slug? I trying doing this at the DB level but it did not bubble up to the app.