Skip to content

Commit

Permalink
Fix breakage of content upload with repository
Browse files Browse the repository at this point in the history
re: #9257
pulp#1556
  • Loading branch information
gerrod3 committed Aug 25, 2021
1 parent ebc2ea0 commit 240f50d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pulpcore/plugin/viewsets/content.py
Expand Up @@ -76,18 +76,20 @@ def create(self, request):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)

content_data = self.init_content_data(serializer, request)
task_payload = self.init_content_data(serializer, request)

resources = []
repository = serializer.validated_data.get("repository")
if repository:
content_data.append(repository)
resources.append(repository)

app_label = self.queryset.model._meta.app_label
task = dispatch(
tasks.base.general_create,
args=(app_label, serializer.__class__.__name__),
exclusive_resources=resources,
kwargs={
"data": content_data,
"data": task_payload,
"context": self.get_deferred_context(request),
},
)
Expand Down

0 comments on commit 240f50d

Please sign in to comment.