Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kbecker42 committed Mar 6, 2023
1 parent 72b951c commit 227da7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybossa/api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class ProjectAPI(APIBase):
def _preprocess_request(self, request):
# Limit maximum post data size.
content_length = request.content_length if request else 0
max_length_mb = current_app.config.get('TASK_PRESENTER_MAX_SIZE_MB', 2) if current_app and current_app.config else 0
max_length_mb = current_app.config.get('TASK_PRESENTER_MAX_SIZE_MB', 2)
max_length_bytes = max_length_mb * 1024 * 1024 # Maximum POST data size (MB)
if content_length and max_length_bytes and content_length > max_length_bytes:
if content_length > max_length_bytes:
raise BadRequest('The task presenter/guidelines content exceeds ' +
str(max_length_mb) +
' MB. Please move large content to an external file.')
Expand Down

0 comments on commit 227da7f

Please sign in to comment.