Commit 93eec9a5 authored by sebastien letort's avatar sebastien letort

test of app version in api.v1.views.jobs right after the app is retrieve.

parent 7e28d952
Pipeline #67179 failed with stage
......@@ -65,6 +65,10 @@ def jobs(request):
if not app:
return JsonResponse({'error': 'Application not found'}, status=404)
if app.get_webapp_version() is None:
log.debug('No usable versions')
return JsonResponse({'error': "This app is not yet published"}, status=404)
queue = app.job_queue
if 'job[queue]' in request.POST:
try:
......@@ -74,9 +78,6 @@ def jobs(request):
log.info("Job submit by user %s", user)
job = Job.objects.create(param=request.POST.get('job[param]', ''), queue=queue, webapp=app, user=user)
if app.get_webapp_version() is None:
log.debug('No usable versions')
return JsonResponse({'error': "This app is not yet published"}, status=404)
job.version = app.get_webapp_version().number # TODO: add version selection in the api
upload_data(request.FILES.values(), job)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment