mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 00:20:43 -04:00
display service name in feedback email if user is logged in
also, split out a couple of tests for legibility and clear up some linter errors
This commit is contained in:
committed by
Chris Hill-Scott
parent
154271b46e
commit
199dc24cb8
@@ -74,8 +74,17 @@ def feedback(ticket_type):
|
||||
if form.validate_on_submit():
|
||||
user_email = form.email_address.data
|
||||
user_name = form.name.data or None
|
||||
feedback_msg = 'Environment: {}\n{}\n{}'.format(
|
||||
if current_service:
|
||||
service_string = 'Service "{name}": {url}\n'.format(
|
||||
name=current_service['name'],
|
||||
url=url_for('main.service_dashboard', service_id=current_service['id'], _external=True)
|
||||
)
|
||||
else:
|
||||
service_string = ''
|
||||
|
||||
feedback_msg = 'Environment: {}\n{}{}\n{}'.format(
|
||||
url_for('main.index', _external=True),
|
||||
service_string,
|
||||
'' if user_email else '{} (no email address supplied)'.format(form.name.data),
|
||||
form.feedback.data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user