mirror of
https://github.com/Hopiu/django-uuslug.git
synced 2026-03-16 20:10:24 +00:00
Clarified an exception
This commit is contained in:
parent
9ffd0d2b1d
commit
71fcf831a6
1 changed files with 2 additions and 0 deletions
|
|
@ -94,6 +94,8 @@ def uuslug(s, entities=True, decimal=True, hexadecimal=True,
|
|||
slug = s
|
||||
if instance:
|
||||
def get_query():
|
||||
if hasattr(instance, 'objects'):
|
||||
raise Exception("Error: you must pass an instance to uuslug, not a model.")
|
||||
query = instance.__class__.objects.filter(**{slug_field: slug})
|
||||
if filter_dict:
|
||||
query = query.filter(**filter_dict)
|
||||
|
|
|
|||
Loading…
Reference in a new issue