Skip to content

Commit

Permalink
Switch from TESTING to DEBUG for printing email.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmccurley committed Jan 11, 2025
1 parent 44c8247 commit 070d606
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions webapp/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def user():
ts=timestamp,
_external=True)}
msg.body = app.jinja_env.get_template('admin/new_account.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(msg.body)
mail.send(msg)
flash('User {} was created and they were notified.'.format(form.email.data))
Expand Down Expand Up @@ -276,7 +276,7 @@ def approve_final():
'paperid': paperid,
'copyedit_url': url_for('admin_file.copyedit_home', _external=True)}
editor_msg.body = app.jinja_env.get_template('admin/copyedit_approved.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(editor_msg.body)
mail.send(editor_msg)
############ send a message to the author.
Expand All @@ -289,7 +289,7 @@ def approve_final():
sender=app.config['EDITOR_EMAILS'],
recipients=[paper_status.email])
author_msg.body = app.jinja_env.get_template('admin/author_finished.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(author_msg.body)
mail.send(author_msg)
except Exception as e:
Expand Down Expand Up @@ -505,7 +505,7 @@ def finish_copyedit():
sender=app.config['EDITOR_EMAILS'],
recipients=[paper_status.email])
author_msg.body = app.jinja_env.get_template('admin/author_finished.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(author_msg.body)
mail.send(author_msg)
log_event(db, paperid, 'Copy edit was finished and author notified')
Expand All @@ -531,7 +531,7 @@ def finish_copyedit():
'final_url': url_for('home_bp.view_copyedit', paperid=paperid,auth=create_hmac([paperid, Version.COPYEDIT.value]),
_external=True)}
msg.body = app.jinja_env.get_template('admin/copyedit_finished.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(msg.body)
mail.send(msg)
log_event(db, paperid, 'Copy edit was finished and author notified')
Expand Down
2 changes: 1 addition & 1 deletion webapp/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _send_login_link(initiator, email):
auth=create_hmac([email, str(ts)]),
_external=True)}
msg.body = app.jinja_env.get_template('recover_password.txt').render(maildata)
if app.config['TESTING']:
if app.config['DEBUG']:
print(msg.body)
mail.send(msg)
return True
Expand Down
4 changes: 2 additions & 2 deletions webapp/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def compile_for_copyedit():
copyedit_url = url_for('admin_file.copyedit', paperid=paperid, _external=True)
msg.body = 'A paper for CiC is being compiled for copy editing.\n\nYou can view it at {}'.format(copyedit_url)
mail.send(msg)
if app.config['TESTING']:
if app.config['DEBUG']:
print(msg.body)
data = {'title': 'Compiling your LaTeX for copy editor',
'status_url': status_url,
Expand Down Expand Up @@ -547,7 +547,7 @@ def final_review():
final_review_url = url_for('admin_file.final_review', paperid=paperid, _external=True)
msg.body = 'A paper for CiC needs final review.\n\nYou can view it at {}'.format(final_review_url)
mail.send(msg)
if app.config['TESTING']:
if app.config['DEBUG']:
print(msg.body)
return render_template('message.html',
title='Your paper will be reviewed',
Expand Down

0 comments on commit 070d606

Please sign in to comment.