Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3033 - Include bugform.js on homepage for form-v2 experiment #3035

Merged
merged 2 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions webcompat/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@
<script src="{{ url_for('static', filename='js/lib/models/label-list.js') }}"></script>
<script src="{{ url_for('static', filename='js/lib/models/issue.js') }}"></script>
<script src="{{ url_for('static', filename='js/lib/untriaged.js') }}"></script>
{# Normally this file is in the webcompat bundle, but the form-v2 #}
{# experiment does not include it. So include it here. #}
{# this can be removed when https://github.com/webcompat/webcompat.com/issues/3034 is fixed. #}
{% if ab_active('exp') == 'form-v2' %}
<script src="{{ url_for('static', filename='js/lib/bugform.js') }}"></script>
{% endif %}
{%- endif -%}
{%- endblock %}
4 changes: 3 additions & 1 deletion webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def create_issue():
elif request_type == 'create':
# Check if there is a form
if not request.form:
log.info('POST request without form.')
log.info('400: POST request without form.')
abort(400)
# Adding parameters to the form
form = request.form.copy()
Expand All @@ -290,6 +290,7 @@ def create_issue():
url=form['url'].encode('utf-8')))
# Check if the form is valid
if not is_valid_issue_form(form):
log.info('400: POST request w/o valid form (is_valid_issue_form).')
abort(400)
if form.get('submit_type') == PROXY_REPORT:
# Checking blacklisted domains
Expand All @@ -315,6 +316,7 @@ def create_issue():
session['form'] = form
return redirect(url_for('login'))
else:
log.info('400: Something else happened.')
abort(400)


Expand Down