justinmayer / django-autoslug

AutoSlugField for Django. Supports (but not does not require) unidecode/pytils for transliteration. Old issue tracker is at Bitbucket: https://bitbucket.org/neithere/django-autoslug/issues

Home Page:https://readthedocs.org/projects/django-autoslug/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uniqueness Manager is always overridden

wkleinheerenbrink opened this issue · comments

If you override the de manager that check for uniqueness, it will always be overridden bij de Default manager in case of empty result-set (ie. in case the value is unique according to the manager).

Error is at:
https://github.com/justinmayer/django-autoslug/blob/master/autoslug/utils.py#L64

The check is if not manager, which should be if manager is None. By doing if not manager, the results of if not QuerySet<[]> will make the AutoSlugField use the fallback of defaultmanager.