Skip to content

Commit

Permalink
use default value for MAX_IMAGE_UPLOAD_SIZE_MB
Browse files Browse the repository at this point in the history
  • Loading branch information
nsyed22 committed Jan 17, 2023
1 parent daefff8 commit f622f6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybossa/view/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def upload_task_guidelines_image(short_name):
file_size_mb = file.seek(0, os.SEEK_END) / 1024 / 1024
file.seek(0, os.SEEK_SET)
file.filename = secure_filename(file.filename)
if file_size_mb < current_app.config.get('MAX_IMAGE_UPLOAD_SIZE_MB'):
if file_size_mb < current_app.config.get('MAX_IMAGE_UPLOAD_SIZE_MB', 5):
container = "user_%s" % current_user.id
uploader.upload_file(file, container=container)
imgurls.append(get_avatar_url(
Expand All @@ -558,7 +558,7 @@ def upload_task_guidelines_image(short_name):
current_app.config.get('AVATAR_ABSOLUTE')
))
else:
flash(gettext('File must be smaller than ' + str(current_app.config.get('MAX_IMAGE_UPLOAD_SIZE_MB')) + ' MB.'))
flash(gettext('File must be smaller than ' + str(current_app.config.get('MAX_IMAGE_UPLOAD_SIZE_MB', 5)) + ' MB.'))
large_file = True
error = True

Expand Down

0 comments on commit f622f6c

Please sign in to comment.