Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniqueness Manager is always overridden #65

Open
wkleinheerenbrink opened this issue Apr 14, 2020 · 0 comments
Open

Uniqueness Manager is always overridden #65

wkleinheerenbrink opened this issue Apr 14, 2020 · 0 comments

Comments

@wkleinheerenbrink
Copy link

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.

mpachas added a commit to mpachas/django-autoslug that referenced this issue Sep 22, 2020
justinmayer#65
A custom defined manager will be overridden by the `_default_manager` when the custom manager returns `QuerySet<[]>`, because `bool(QuerySet<[]>) is False`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant