diff --git a/CHANGES/929.bugfix b/CHANGES/929.bugfix new file mode 100644 index 00000000..fb49d5e5 --- /dev/null +++ b/CHANGES/929.bugfix @@ -0,0 +1 @@ +Fixed PYTHON_GROUP_UPLOADS failing when domains are turned on. \ No newline at end of file diff --git a/pulp_python/app/pypi/views.py b/pulp_python/app/pypi/views.py index 0174c937..03039db5 100644 --- a/pulp_python/app/pypi/views.py +++ b/pulp_python/app/pypi/views.py @@ -8,7 +8,6 @@ from django.shortcuts import redirect from datetime import datetime, timezone, timedelta -from rest_framework.reverse import reverse from django.contrib.sessions.models import Session from django.db import transaction from django.db.utils import DatabaseError @@ -29,7 +28,7 @@ from pulpcore.plugin.viewsets import OperationPostponedResponse from pulpcore.plugin.tasking import dispatch -from pulpcore.plugin.util import get_domain +from pulpcore.plugin.util import get_domain, get_url from pulpcore.plugin.exceptions import TimeoutException from pulp_python.app.models import ( PythonDistribution, @@ -200,10 +199,15 @@ def create_group_upload_task(self, cur_session, repository, artifact, filename, cur_session['artifacts'] = [(str(artifact.sha256), filename)] cur_session.modified = False cur_session.save() - result = dispatch(tasks.upload_group, exclusive_resources=[artifact, repository], - kwargs={"session_pk": str(cur_session.session_key), - "repository_pk": str(repository.pk)}) - return reverse('tasks-detail', args=[result.pk], request=None) + task = dispatch( + tasks.upload_group, + exclusive_resources=[artifact, repository], + kwargs={ + "session_pk": str(cur_session.session_key), + "repository_pk": str(repository.pk), + }, + ) + return get_url(task) class SimpleView(PackageUploadMixin, ViewSet):