Skip to content
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

Fix Charts endpoint JSON response not rendering #2022

Merged
merged 3 commits into from
Feb 25, 2021

Conversation

DavisRayM
Copy link
Contributor

Changes / Features implemented

  • Set xform data key to the XForm ID when no accepted_format is given

Steps taken to verify this change does what is intended

  • Updated tests

Side effects of implementing this change

  • When no accepted format is given the return xform value shall be the ID

Copy link
Contributor

@ivermac ivermac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I've added a question though

@@ -473,7 +473,7 @@ def get_chart_data_for_field(field_name,
except DataError as e:
raise ParseError(text(e))
else:
if accepted_format == 'json':
if accepted_format == 'json' or not accepted_format:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need or not accepted_format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes the format kwarg is empty; the format kwarg is the value we use to determine what type of response to return(but by default we return JSON)

@DavisRayM DavisRayM merged commit edb12a7 into master Feb 25, 2021
@DavisRayM DavisRayM deleted the fix-chart-endpoint-json-response-rendering branch February 25, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants