Skip to content

Commit

Permalink
Issue #882. Hook up screenshots into the uploads mechanism.
Browse files Browse the repository at this point in the history
(request.form['screenshot'] is added in bugform.js, which will
added in #879)
  • Loading branch information
Mike Taylor committed Dec 28, 2015
1 parent 020a2e5 commit e041a27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webcompat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def create_issue():
flash(msg, 'notimeout')
return redirect(url_for('index'))
form['ua_header'] = request.headers.get('User-Agent')
# Do we have an image ready to be uploaded?
image = request.files['image']
if image:
# Do we have an image or screenshot ready to be uploaded?
if ((request.files['image'] and request.files['image'].filename) or
request.form.get('screenshot')):
form['image_upload'] = json.loads(upload()[0])
if form.get('submit-type') == AUTH_REPORT:
if g.user: # If you're already authed, submit the bug.
Expand Down Expand Up @@ -245,7 +245,7 @@ def download_file(filename):
Python app.
'''
return send_from_directory(
app.config['UPLOADS_DEFAULT_DEST'] + '/uploads', filename)
app.config['UPLOADS_DEFAULT_DEST'], filename)


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

0 comments on commit e041a27

Please sign in to comment.