diff --git a/avatar/views.py b/avatar/views.py index c685fb8..f0a894d 100644 --- a/avatar/views.py +++ b/avatar/views.py @@ -140,6 +140,7 @@ def delete(request, extra_context={}, next_override=None, *args, **kwargs): if delete_avatar_form.is_valid(): ids = delete_avatar_form.cleaned_data['choices'] if unicode(avatar.id) in ids and avatars.count() > len(ids): + # Find the next best avatar, and set it as the new primary for a in avatars: if unicode(a.id) not in ids: a.primary = True