Exemple #1
0
 def put(self, req, filename=None, format=None):
     file_obj = req.data['file']
     uploaded_task = UploadedTask.objects.get(
         pk=req.QUERY_PARAMS.get('uploaded_task_pk'))
     process_uploaded_task(file_obj, uploaded_task)
     deploy_uploaded_task.delay(uploaded_task)
     return Response({}, status=HTTP_201_CREATED)
Exemple #2
0
 def put(self, req, filename=None, format=None):
     file_obj = req.data['file']
     uploaded_task = UploadedTask.objects.get(
         pk=req.QUERY_PARAMS.get('uploaded_task_pk')
     )
     process_uploaded_task(file_obj, uploaded_task)
     deploy_uploaded_task.delay(uploaded_task)
     return Response({}, status=HTTP_201_CREATED)
Exemple #3
0
    def post(self, req):
        form = UploadTaskForm(req.POST, req.FILES)
        if not form.is_valid():
            context = RequestContext(req, {'form': form})
            return render_to_response(self.template_name,
                                      context_instance=context)

        uploaded_file = req.FILES['task_file']
        process_uploaded_task(uploaded_file, req.user)

        return redirect('panel')
Exemple #4
0
    def post(self, req):
        form = UploadTaskForm(req.POST, req.FILES)
        if not form.is_valid():
            context = RequestContext(req, {'form': form})
            return render_to_response(self.template_name,
                                      context_instance=context)

        uploaded_file = req.FILES['task_file']
        process_uploaded_task(uploaded_file, req.user)

        return redirect('panel')