Skip to content

Commit

Permalink
Geoprocessing API: Add Location header with url to poll
Browse files Browse the repository at this point in the history
* Add a Location header with the `/jobs/$job-id` url to poll
  • Loading branch information
Alice Rottersman committed Aug 29, 2017
1 parent e6bc230 commit f2362b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mmw/apps/geoprocessing_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from rest_framework.permissions import AllowAny

from django.utils.timezone import now
from django.core.urlresolvers import reverse

from apps.core.models import Job
from apps.core.tasks import save_job_error, save_job_result
Expand Down Expand Up @@ -45,7 +46,8 @@ def start_rwd(request, format=None):
{
'job': task_list.id,
'status': 'started',
}
},
headers={'Location': reverse('get_job', args=[task_list.id])}
)


Expand Down Expand Up @@ -150,5 +152,6 @@ def start_celery_job(task_list, job_input, user=None):
{
'job': task_chain.id,
'status': 'started',
}
},
headers={'Location': reverse('get_job', args=[task_chain.id])}
)

0 comments on commit f2362b9

Please sign in to comment.