Oops, need to actually get the first item of the queryset

This commit is contained in:
Mathieu Pillard 2010-01-22 14:54:35 +01:00 committed by Eric Florenzano
parent b4646e5b5f
commit fe2fe0c1c3

View file

@ -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]