|
8 | 8 | from django.shortcuts import redirect |
9 | 9 | from datetime import datetime, timezone, timedelta |
10 | 10 |
|
11 | | -from rest_framework.reverse import reverse |
12 | 11 | from django.contrib.sessions.models import Session |
13 | 12 | from django.db import transaction |
14 | 13 | from django.db.utils import DatabaseError |
|
29 | 28 |
|
30 | 29 | from pulpcore.plugin.viewsets import OperationPostponedResponse |
31 | 30 | from pulpcore.plugin.tasking import dispatch |
32 | | -from pulpcore.plugin.util import get_domain |
| 31 | +from pulpcore.plugin.util import get_domain, get_url |
33 | 32 | from pulpcore.plugin.exceptions import TimeoutException |
34 | 33 | from pulp_python.app.models import ( |
35 | 34 | PythonDistribution, |
@@ -200,10 +199,15 @@ def create_group_upload_task(self, cur_session, repository, artifact, filename, |
200 | 199 | cur_session['artifacts'] = [(str(artifact.sha256), filename)] |
201 | 200 | cur_session.modified = False |
202 | 201 | cur_session.save() |
203 | | - result = dispatch(tasks.upload_group, exclusive_resources=[artifact, repository], |
204 | | - kwargs={"session_pk": str(cur_session.session_key), |
205 | | - "repository_pk": str(repository.pk)}) |
206 | | - return reverse('tasks-detail', args=[result.pk], request=None) |
| 202 | + task = dispatch( |
| 203 | + tasks.upload_group, |
| 204 | + exclusive_resources=[artifact, repository], |
| 205 | + kwargs={ |
| 206 | + "session_pk": str(cur_session.session_key), |
| 207 | + "repository_pk": str(repository.pk), |
| 208 | + }, |
| 209 | + ) |
| 210 | + return get_url(task) |
207 | 211 |
|
208 | 212 |
|
209 | 213 | class SimpleView(PackageUploadMixin, ViewSet): |
|
0 commit comments