mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Actually not a good idea at all :) Just don't bother updating and that's it.
This commit is contained in:
parent
b7811b3d14
commit
8a680ecd66
1 changed files with 1 additions and 4 deletions
|
|
@ -34,10 +34,7 @@ class Avatar(models.Model):
|
|||
return _(u'Avatar for %s') % self.user
|
||||
|
||||
def save(self, force_insert=False, force_update=False):
|
||||
if AVATAR_MAX_AVATARS_PER_USER == 1:
|
||||
first = Avatar.objects.filter(user=self.user)[0]
|
||||
first.delete()
|
||||
elif self.primary and AVATAR_MAX_AVATARS_PER_USER > 1:
|
||||
if self.primary and AVATAR_MAX_AVATARS_PER_USER > 1:
|
||||
avatars = Avatar.objects.filter(user=self.user, primary=True)\
|
||||
.exclude(id=self.id)
|
||||
avatars.update(primary=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue