check if a image exists.
This commit is contained in:
@@ -127,6 +127,9 @@ class Member(models.Model):
|
||||
verbose_name_plural = "Mitglieder"
|
||||
|
||||
def clean(self):
|
||||
if not self.image:
|
||||
raise ValidationError(_("Es fehlt das Profilbild."))
|
||||
|
||||
if self.image.height < 150 or self.image.width < 150:
|
||||
raise ValidationError(
|
||||
_("Das Bild ist zu klein. (Höhe: {}, Breite: {})").format(
|
||||
|
||||
Reference in New Issue
Block a user