Skip to content

Commit 9212c3a

Browse files
committed
Issue #2653. Encode details as JSON before filling input
Otherwise, we end up with a unicode string (a stringified dict), which we later attempt to decode as JSON -- and that will fail (because unicode strings that look like python dicts are not JSON).
1 parent 28767cf commit 9212c3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webcompat/form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def get_form(form_data):
103103
ua_header = form_data['user_agent']
104104
# Populate the form
105105
bug_form.browser.data = get_browser(ua_header)
106+
bug_form.details.data = json.dumps(form_data.get('details'))
106107
bug_form.extra_labels = form_data.get('extra_labels', None)
107108
bug_form.os.data = get_os(ua_header)
108109
bug_form.reported_with.data = form_data.get('src', 'web')
@@ -119,7 +120,6 @@ def get_details(details_string):
119120
"""
120121
content = details_string
121122
rv = ''
122-
123123
try:
124124
details = json.loads(content)
125125
rv = ''.join(['<li>{k}: {v}</li>'.format(k=k, v=get_str_value(v))

0 commit comments

Comments
 (0)