Skip to content

Commit

Permalink
Issue #1030. Get browser_name from the get_browser helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Apr 29, 2016
1 parent 36751c0 commit e52200c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,22 @@ def index():
ua_header = request.headers.get('User-Agent')
bug_form.browser.data = get_browser(ua_header)
bug_form.os.data = get_os(ua_header)
# browser_name is used in topbar.html to offer add-on downloads
browser_name = get_browser(ua_header).rsplit(' ', 1).lower()
# GET means you want to file a report.
if request.method == 'GET':
if g.user:
get_user_info()
return render_template('index.html', form=bug_form)
return render_template('index.html', form=bug_form,
browser=browser_name)
# Validate, then create issue.
elif bug_form.validate_on_submit():
return create_issue()

else:
# Validation failed, re-render the form with the errors.
return render_template('index.html', form=bug_form)
return render_template('index.html', form=bug_form,
browser=browser_name)


@app.route('/issues')
Expand Down

0 comments on commit e52200c

Please sign in to comment.