Skip to content

Commit

Permalink
Check if manager is None instead of Falsy
Browse files Browse the repository at this point in the history
justinmayer#65
A custom defined manager will be overridden by the `_default_manager` when the custom manager returns `QuerySet<[]>`, because `bool(QuerySet<[]>) is False`
  • Loading branch information
mpachas authored Sep 22, 2020
1 parent 87d75ec commit e270c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoslug/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate_unique_slug(field, instance, slug, manager):

index = 1

if not manager:
if manager is None:
manager = field.model._default_manager


Expand Down

0 comments on commit e270c28

Please sign in to comment.