Issue #3705
closedAsynchronous updates to list objects does not work
Description
When I try to update a python project: `http PATCH $REMOTE_HREF name='foo' projects:='[{"name":"pip-tools", "version_specifier":">=1.12,<=2.0"}]'`
`projects` always gets passed into `PythonRemoteSerializer.update()` as `[]`
Tracing through the code shows that we take the data and pass it to a QueryDict before passing it to a serializer: https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/tasks/base.py#L32
Talking with @dkliban, this is done because there is some code that checks if it was a form submission from the browsable API or if it came from the rest API directly and not having the querydict there was causing it to think it was a form submission. A regular dictionary was making it always think it was a form submission.
But with this QueryDict, drf thinks list data is an HTML Input [https://github.com/encode/django-rest-framework/blob/master/rest_framework/serializers.py#L603\]
because the QueryDict has a getlist attribute on it [https://github.com/encode/django-rest-framework/blob/master/rest_framework/utils/html.py#L9\]
And parse_html_list returns a empty list on this data.
Updated by amacdona@redhat.com over 6 years ago
@dkliban, if we dropped the browsable interface, could we drop the QueryDict?
Updated by amacdona@redhat.com over 6 years ago
- Subject changed from Updates to list objects does not work to Asynchronous updates to list objects does not work
Updated by CodeHeeler over 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 37
Updated by bizhang over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to bizhang
Updated by bizhang over 6 years ago
- Status changed from ASSIGNED to POST
Added by werwty over 6 years ago
Added by werwty over 6 years ago
Revision 8302f6c9 | View on GitHub
Stop creating QueryDict for async update data
I could not find any asnyc updates that breaks with this change. Smash also passes cleanly. I suspect breakage might have occured when we had more complex nested relationships.
Updated by werwty over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|8302f6c979d1cec24af7f1a633b2706ffda943a2.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Stop creating QueryDict for async update data
I could not find any asnyc updates that breaks with this change. Smash also passes cleanly. I suspect breakage might have occured when we had more complex nested relationships.
closes #3705 https://pulp.plan.io/issues/3705