mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Preserve message in session if we go out of hours
This is a real edge case, but it seems worth handling. How you’d get to this case: - it’s 5:29pm and you start to describe the problem you’re having - it’s 5:31pm and you click ‘submit’ - you’re redirected to the triage page because we’re now out of hours - you click ‘this is a serious problem’ What would be bad thing to happen: - you’re back on the message page and all the stuff you’ve written is gone What would be a good thing to happen: - we save the message in a session so that you can check it again before sending it
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import requests
|
||||
import pytz
|
||||
from flask import render_template, url_for, redirect, flash, current_app, abort, request
|
||||
from flask import render_template, url_for, redirect, flash, current_app, abort, request, session
|
||||
from flask_login import current_user
|
||||
from app import convert_to_boolean, current_service, service_api_client
|
||||
from app.main import main
|
||||
@@ -41,6 +41,9 @@ def feedback(ticket_type):
|
||||
abort(404)
|
||||
|
||||
form = Support()
|
||||
if not form.feedback.data:
|
||||
form.feedback.data = session.pop('feedback_message', '')
|
||||
|
||||
severe = request.args.get('severe')
|
||||
|
||||
urgent = any((
|
||||
@@ -54,6 +57,7 @@ def feedback(ticket_type):
|
||||
))
|
||||
|
||||
if needs_triage(ticket_type, severe):
|
||||
session['feedback_message'] = form.feedback.data
|
||||
return redirect(url_for('.triage'))
|
||||
|
||||
if needs_escalation(ticket_type, severe):
|
||||
|
||||
Reference in New Issue
Block a user