You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
The text was updated successfully, but these errors were encountered:
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`
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 beif manager is None
. By doingif not manager
, the results ofif not QuerySet<[]>
will make the AutoSlugField use the fallback of defaultmanager.The text was updated successfully, but these errors were encountered: