mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Yet another attempt
This commit is contained in:
parent
4ab2b379e7
commit
805920e521
1 changed files with 1 additions and 2 deletions
|
|
@ -52,8 +52,7 @@ class UploadAvatarForm(forms.Form):
|
|||
'max_valid_size': filesizeformat(settings.AVATAR_MAX_SIZE)})
|
||||
|
||||
count = Avatar.objects.filter(user=self.user).count()
|
||||
if (settings.AVATAR_MAX_AVATARS_PER_USER > 1 and
|
||||
count >= settings.AVATAR_MAX_AVATARS_PER_USER):
|
||||
if 1 < settings.AVATAR_MAX_AVATARS_PER_USER <= count:
|
||||
error = _("You already have %(nb_avatars)d avatars, "
|
||||
"and the maximum allowed is %(nb_max_avatars)d.")
|
||||
raise forms.ValidationError(error % {
|
||||
|
|
|
|||
Loading…
Reference in a new issue