Skip to content

Commit ae16f6a

Browse files
authored
Merge pull request #931 from gerrod3/group-upload-task-fix
Fixed group uploads failing when using domains
2 parents 6b526cf + 61afb0a commit ae16f6a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGES/929.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed PYTHON_GROUP_UPLOADS failing when domains are turned on.

pulp_python/app/pypi/views.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from django.shortcuts import redirect
99
from datetime import datetime, timezone, timedelta
1010

11-
from rest_framework.reverse import reverse
1211
from django.contrib.sessions.models import Session
1312
from django.db import transaction
1413
from django.db.utils import DatabaseError
@@ -29,7 +28,7 @@
2928

3029
from pulpcore.plugin.viewsets import OperationPostponedResponse
3130
from pulpcore.plugin.tasking import dispatch
32-
from pulpcore.plugin.util import get_domain
31+
from pulpcore.plugin.util import get_domain, get_url
3332
from pulpcore.plugin.exceptions import TimeoutException
3433
from pulp_python.app.models import (
3534
PythonDistribution,
@@ -205,15 +204,15 @@ def create_group_upload_task(self, cur_session, repository, artifact, filename,
205204
cur_session["artifacts"] = [(str(artifact.sha256), filename)]
206205
cur_session.modified = False
207206
cur_session.save()
208-
result = dispatch(
207+
task = dispatch(
209208
tasks.upload_group,
210209
exclusive_resources=[artifact, repository],
211210
kwargs={
212211
"session_pk": str(cur_session.session_key),
213212
"repository_pk": str(repository.pk),
214213
},
215214
)
216-
return reverse("tasks-detail", args=[result.pk], request=None)
215+
return get_url(task)
217216

218217

219218
class SimpleView(PackageUploadMixin, ViewSet):

0 commit comments

Comments
 (0)