mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-17 12:29:20 -04:00
Refactor support ticket into a template
This is the same thing we do for go live requests and branding requests. It’s easier to do templating logic in a templating language than in Python.
This commit is contained in:
@@ -114,17 +114,10 @@ def feedback(ticket_type):
|
||||
if form.validate_on_submit():
|
||||
user_email = form.email_address.data
|
||||
user_name = form.name.data or None
|
||||
if current_service:
|
||||
service_string = 'Service: "{name}"\n{url}\n'.format(
|
||||
name=current_service.name,
|
||||
url=url_for('main.service_dashboard', service_id=current_service.id)
|
||||
)
|
||||
else:
|
||||
service_string = ''
|
||||
|
||||
feedback_msg = '{}\n{}'.format(
|
||||
form.feedback.data,
|
||||
service_string,
|
||||
feedback_msg = render_template(
|
||||
'support-tickets/support-ticket.txt',
|
||||
content=form.feedback.data,
|
||||
)
|
||||
|
||||
ticket = NotifySupportTicket(
|
||||
|
||||
5
app/templates/support-tickets/support-ticket.txt
Normal file
5
app/templates/support-tickets/support-ticket.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ content }}
|
||||
{% if current_service -%}
|
||||
Service: "{{ current_service.name }}"
|
||||
{{ url_for('main.service_dashboard', service_id=current_service.id) }}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user