Project

Profile

Help

Issue #3705

closed

Asynchronous updates to list objects does not work

Added by bizhang almost 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 37
Quarter:

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.

Actions #1

Updated by amacdona@redhat.com almost 6 years ago

@dkliban, if we dropped the browsable interface, could we drop the QueryDict?

Actions #2

Updated by amacdona@redhat.com almost 6 years ago

  • Subject changed from Updates to list objects does not work to Asynchronous updates to list objects does not work
Actions #3

Updated by CodeHeeler almost 6 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 37
Actions #4

Updated by bizhang almost 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bizhang
Actions #5

Updated by bizhang almost 6 years ago

  • Status changed from ASSIGNED to POST

Added by werwty almost 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.

closes #3705 https://pulp.plan.io/issues/3705

Added by werwty almost 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.

closes #3705 https://pulp.plan.io/issues/3705

Actions #6

Updated by werwty almost 6 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by daviddavis almost 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #8

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #9

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF