Skip to content

Commit

Permalink
remove f strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nsyed22 committed Dec 11, 2024
1 parent 334d05b commit 68dd9cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pybossa/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def export_tasks(current_user_email_addr, short_name,
msg = '<p>Your export exceeded the maximum file upload size. ' + \
'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}")
current_app.logger.info("uploading exporting tasks to s3 for project, %s", project.id)
conn_kwargs = current_app.config.get('S3_EXPORT_CONN', {})
conn = create_connection(**conn_kwargs)
bucket = conn.get_bucket(bucket_name, validate=False)
Expand All @@ -978,14 +978,14 @@ def export_tasks(current_user_email_addr, short_name,
key.set_contents_from_string(content)
expires_in = current_app.config.get('EXPORT_EXPIRY', 12 * 3600)
url = key.generate_url(expires_in)
current_app.logger.info(f"uploading to s3 done for project {project.id}")
current_app.logger.info("uploading to s3 done for project %s", project.id)
msg = '<p>You can download your file <a href="{}">here</a>.</p>'.format(url)
else:
msg = '<p>Your exported data is attached.</p>'
mail_dict['attachments'] = [Attachment(filename, "application/zip", content)]

current_app.logger.info(
'Tasks export completed - Project: {0}'.format(project.name))
'Tasks export completed - Project: %s', project.name)
else:
# Failure email
mail_dict['subject'] = 'Data export failed for your project: {0}'.format(project.name)
Expand All @@ -1000,14 +1000,14 @@ def export_tasks(current_user_email_addr, short_name,
message = Message(**mail_dict)
mail.send(message)
current_app.logger.info(
'Email sent successfully - Project: {0}'.format(project.name))
'Email sent successfully - Project: %s', project.name)
job_response = '{0} {1} file was successfully exported for: {2}'
return job_response.format(
ty.capitalize(), filetype.upper(), project.name)
except Exception as e:
current_app.logger.exception(
'Export email failed - Project: {0}, exception: {1}'
.format(project.name, str(e)))
'Export email failed - Project: %s, exception: %s',
project.name, str(e))
subject = 'Email delivery failed for your project: {0}'.format(project.name)
msg = 'There was an error when attempting to deliver your data export via email.'
body = 'Hello,\n\n' + msg + '\n\nThe {0} team.'
Expand Down

0 comments on commit 68dd9cc

Please sign in to comment.