-
Notifications
You must be signed in to change notification settings - Fork 203
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 #2042: Send details params content via a hidden input. #2395
Conversation
r? @karlcow |
webcompat/form.py
Outdated
def get_details(details_string): | ||
"""Return details content as a formatted string, if it was JSON. Otherwise, | ||
just return the string as-is.""" | ||
# TODO: file a bug and change DecoderDoctor to encode as JSON so we only |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
c052f22
to
e031394
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/unit/test_helpers.py
Outdated
{'': ''}, {'cool': 'cool'}, {u'\U0001f480': u'💀'}] | ||
for test in tests: | ||
for output, _input in test.iteritems(): | ||
self.assertEqual(get_str_value(_input), output) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
tests/unit/test_helpers.py
Outdated
{'': ''}, {'cool': 'cool'}, {u'\U0001f480': u'💀'}] | ||
for test in tests: | ||
for output, _input in test.iteritems(): | ||
self.assertEqual(get_str_value(_input), output) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/form.py
Outdated
try: | ||
details = json.loads(content) | ||
for key, value in details.iteritems(): | ||
rv += key + ': ' + get_str_value(value) + '\n' |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/helpers.py
Outdated
@@ -74,6 +74,15 @@ def md5_checksum(file_path): | |||
return m.hexdigest() | |||
|
|||
|
|||
def get_str_value(val): | |||
detailsMap = {False: 'false', True: 'true', None: 'null'} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
webcompat/form.py
Outdated
details = form_object.get('details') | ||
if details: | ||
body += u'\n\n**Details**\n{details}'.format( | ||
details=get_details(details)) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
e031394
to
5c2a907
Compare
Travis tests have failedHey @miketaylr, |
@karlcow can you have another look please? The last commit is untested, this airplane wifi is like 28kbps, I don't have the patience to file a test issue (will do tonight or tomorrow). |
With your latest modifications.
This one is difficult to test locally, given this is happening only when we use |
but nosetests are working locally :) |
thanks! |
(this was after clicking "report anonymously") |
|
Ah, unrelated to nginx. Just a python error:
Will file a bug and send in a patch. Yay for untested airplane code. |
The user won't see the pref values until the report has been created. This should be less confusing.