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
https://readthedocs.org/projects/django-autoslug/
GNU Lesser General Public License v3.0
295 stars 105 forks source link

Uniqueness Manager is always overridden #65

Open wkleinheerenbrink opened 4 years ago

wkleinheerenbrink commented 4 years ago

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.