mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Oops, need to actually get the first item of the queryset
This commit is contained in:
parent
b4646e5b5f
commit
fe2fe0c1c3
1 changed files with 4 additions and 0 deletions
|
|
@ -54,6 +54,10 @@ def _get_avatars(user):
|
|||
|
||||
# Current avatar
|
||||
avatar = avatars.filter(primary=True)[:1]
|
||||
if avatar:
|
||||
avatar = avatar[0]
|
||||
else:
|
||||
avatar = None
|
||||
|
||||
# Slice the default set now that we used the queryset for the primary avatar
|
||||
avatars = avatars[:AVATAR_MAX_AVATARS_PER_USER]
|
||||
|
|
|
|||
Loading…
Reference in a new issue