-
Notifications
You must be signed in to change notification settings - Fork 115
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
Django ?format
doesn't work correctly in some endpoints
#4450
Comments
I think this can be fixed by adding Lines 372 to 382 in bc9ca51
|
That's not even supposed to be a filter. You should user the encoding header to determine the used format. Also i'm unsure we support anything but json anyway. |
@mdellweg Okay, it certainly works with accept headers, but it's still inconsistent with the Also, for https://issues.redhat.com/browse/AAH-2148, we want to use the 'pretty' format ('format=api') for the galaxy-beta. Currently, it doesn't work, and I'm wondering if this issue could be related to Pulp not supporting it and not displaying it in the production image. |
Looks like both methods are supported after all: |
@jerabekjiri can you file your solution as a PR? |
Version
Describe the bug
Pulp incorrectly assumes that
?format=api|json
is a filter parameter instead of the django rendering format type. This issue only occurs in some endpoints.To Reproduce
Steps to reproduce the behavior:
Visit endpoints
/pulp/api/v3/repositories/?format=api
or/pulp/api/v3/repositories/ansible/ansible/?format=json
:/pulp/api/v3/repositories/?format=test
:Expected behavior
Should switch between raw format and Django's pretty format, and display the data as usual.
Additional context
Discovered in ansible/galaxy_ng#1891
The text was updated successfully, but these errors were encountered: