Skip to content

Commit

Permalink
issue webcompat#3380 - Cleans up code
Browse files Browse the repository at this point in the history
These are breadcrumbs of dead code and useless redirection of variables.

Let's remove them before modifying the Form.
  • Loading branch information
karlcow committed Jul 14, 2020
1 parent fbaba42 commit 23f2665
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions webcompat/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from flask_wtf.file import FileField
from markupsafe import Markup
from wtforms import HiddenField
from wtforms import Label
from wtforms import RadioField
from wtforms import StringField
from wtforms import TextAreaField
Expand All @@ -38,8 +37,6 @@
from webcompat.helpers import get_details_list
from webcompat.helpers import is_json_object

AUTH_REPORT = 'github-auth-report'
PROXY_REPORT = 'github-proxy-report'
SCHEMES = ('http://', 'https://')
BAD_SCHEMES = ('http:/', 'https:/', 'http:', 'https:')
GITHUB_HELP = '_From [webcompat.com](https://webcompat.com/) with ❤️_'
Expand Down
1 change: 0 additions & 1 deletion webcompat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import requests
from ua_parser import user_agent_parser

from webcompat import api
from webcompat import app
from webcompat import github

Expand Down
6 changes: 2 additions & 4 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
from webcompat.api.endpoints import proxy_issue
from webcompat.db import session_db
from webcompat.db import User
from webcompat.form import AUTH_REPORT
from webcompat.form import get_form
from webcompat.form import FormWizard
from webcompat.form import PROXY_REPORT
from webcompat.form import normalize_url
from webcompat.helpers import ab_active
from webcompat.helpers import ab_current_experiments
Expand Down Expand Up @@ -305,7 +303,7 @@ def create_issue():
msg = app.config['IS_DARKNET_DOMAIN'].format(form['url'])
flash(msg, 'notimeout')
return redirect(url_for('index'))
if form.get('submit_type') == PROXY_REPORT:
if form.get('submit_type') == 'github-proxy-report':
if not app.config['ANONYMOUS_REPORTING_ENABLED']:
abort(400)
# Checking blocked domains
Expand All @@ -319,7 +317,7 @@ def create_issue():
return redirect(
url_for('show_issue', number=json_response.get('number')))
# Authenticated reporting
if form.get('submit_type') == AUTH_REPORT:
if form.get('submit_type') == 'github-auth-report':
if g.user: # If you're already authed, submit the bug.
json_response = report_issue(form)
session['show_thanks'] = True
Expand Down

0 comments on commit 23f2665

Please sign in to comment.