This commit is contained in:
Gabriel Augendre 2024-05-01 23:32:38 +02:00 committed by crocmagnon-pr[bot]
parent 3f5df89c85
commit e4f68895b3

View file

@ -164,7 +164,8 @@ class CharacterCapability:
def validate_image(fieldfile_obj, megabytes_limit: float):
filesize = fieldfile_obj.file.size
if filesize > megabytes_limit * 1024 * 1024:
raise ValidationError("La taille maximale est de %sMo" % str(megabytes_limit))
msg = f"La taille maximale est de {megabytes_limit}Mo"
raise ValidationError(msg)
class Character(models.Model):