Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
/ pulp Public archive

Commit

Permalink
Stop creating QueryDict for async update data
Browse files Browse the repository at this point in the history
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
  • Loading branch information
werwty committed May 31, 2018
1 parent 5c6b0fe commit 8302f6c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pulpcore/pulpcore/app/tasks/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from django.http import QueryDict

from pulpcore.app.apps import get_plugin_config


Expand Down Expand Up @@ -29,9 +27,7 @@ def general_update(instance_id, app_label, serializer_name, *args, **kwargs):
partial = kwargs.pop('partial', False)
serializer_class = get_plugin_config(app_label).named_serializers[serializer_name]
instance = serializer_class.Meta.model.objects.get(id=instance_id).cast()
data_querydict = QueryDict('', mutable=True)
data_querydict.update(data)
serializer = serializer_class(instance, data=data_querydict, partial=partial)
serializer = serializer_class(instance, data=data, partial=partial)
serializer.is_valid(raise_exception=True)
serializer.save()

Expand Down

0 comments on commit 8302f6c

Please sign in to comment.