Skip to content

Commit

Permalink
cr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nsyed22 committed Dec 11, 2024
1 parent 8960e26 commit 334d05b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pybossa/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,12 +964,10 @@ def export_tasks(current_user_email_addr, short_name,
max_s3_upload_size = current_app.config.get('EXPORT_MAX_UPLOAD_SIZE', float('Inf'))

if len(content) > max_s3_upload_size:
current_app.logger.info(f"task export exceeded max size. Project ID: {project.id}, Size: {len(content)}")
current_app.logger.info("task export exceeded max size. Project ID: %s, Size: %d", project.id, len(content))
mail_dict['subject'] = 'Data export exceeded max file size: {0}'.format(project.name)
msg = '<p>Your export exceeded the maximum file upload size. ' + \
'Please try again with a smaller subset of tasks or ' + \
'reach out to a {0} administrator for help.</p>'
msg = msg.format(current_app.config.get('BRAND'))
'Please try again with a smaller subset of tasks'
elif len(content) > max_email_size and bucket_name:
current_app.logger.info(f"uploading exporting tasks to s3 for project {project.id}")
conn_kwargs = current_app.config.get('S3_EXPORT_CONN', {})
Expand Down
6 changes: 6 additions & 0 deletions pybossa/settings_local.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ TASK_REQUIRED_FIELDS = {
# TASK_RUN_CSV_EXPORT_INFO_KEY = 'key2'
# RESULT_CSV_EXPORT_INFO_KEY = 'key3'

# Specify export max content sizes (json or csv)
# max size of email attachment
EXPORT_MAX_EMAIL_SIZE = 6 * 1024 * 1024 # 6 MB
# max size of s3 upload
EXPORT_MAX_UPLOAD_SIZE = 1024 * 1024 * 1024 # 1 GB

# A 32 char string for AES encryption of public IPs.
# NOTE: this is really important, don't use the following one
# as anyone with the source code of pybossa will be able to reverse
Expand Down

0 comments on commit 334d05b

Please sign in to comment.