interpolate AVATAR_MAX_SIZE into error message

This commit is contained in:
Aaron 2018-11-19 17:58:30 -06:00
parent e6cc99aa5c
commit cd2bd8f0b7
No known key found for this signature in database
GPG Key ID: 3B5B7597106F0A0E
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ def allowed_avatar_file(file):
size = file.tell()
file.seek(0)
if size > AVATAR_MAX_SIZE:
raise FileValidationException("File size is too large ({0}KB), max size is 2000KB".format(size / 1024))
raise FileValidationException(
"File size is too large ({0}KB), max size is {1}KB".format(size / 1024, AVATAR_MAX_SIZE / 1024)
)
return True