mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Fixed issue #7: get_primary shouldn't return urls, it should return objects (or just None in that case)
Signed-off-by: Jannis Leidel <jannis@leidel.info>
This commit is contained in:
parent
6541bbb67d
commit
c431bf9bf8
1 changed files with 1 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ def get_primary_avatar(user, size=80):
|
|||
try:
|
||||
user = User.objects.get(username=user)
|
||||
except User.DoesNotExist:
|
||||
return get_default_avatar_url()
|
||||
return None
|
||||
avatars = user.avatar_set.order_by('-date_uploaded')
|
||||
primary = avatars.filter(primary=True)
|
||||
if primary.count() > 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue