diff --git a/webcompat/views.py b/webcompat/views.py index 2381b8ea0..f03545d5b 100644 --- a/webcompat/views.py +++ b/webcompat/views.py @@ -34,6 +34,7 @@ from webcompat.api.endpoints import get_rate_limit from webcompat.db import User from webcompat.db import session_db +from urlparse import urlparse @app.teardown_appcontext @@ -119,7 +120,6 @@ def file_issue(): response = report_issue(session['form_data']) # Get rid of stashed form data session.pop('form_data', None) - session['show_thanks'] = True return redirect(url_for('show_issue', number=response.get('number'))) @@ -193,7 +193,6 @@ def create_issue(): if form.get('submit-type') == AUTH_REPORT: if g.user: # If you're already authed, submit the bug. response = report_issue(form) - session['show_thanks'] = True return redirect(url_for('show_issue', number=response.get('number'))) else: # Stash form data into session, go do GitHub auth @@ -201,7 +200,6 @@ def create_issue(): return redirect(url_for('login')) elif form.get('submit-type') == PROXY_REPORT: response = report_issue(form, proxy=True).json() - session['show_thanks'] = True return redirect(url_for('show_issue', number=response.get('number'))) @@ -211,9 +209,10 @@ def show_issue(number): '''Route to display a single issue.''' if g.user: get_user_info() - if session.get('show_thanks'): - flash(number, 'thanks') - session.pop('show_thanks') + if request.referrer: + url_path = urlparse(request.referrer).path + if url_path == '/issues/new': + flash(number, 'thanks') return render_template('issue.html', number=number)