def closerun(request): data_json = request.body try: WorkInProgress.close_run(data_json) return JsonResponse({"message": "closed run", "_id": data_json.get('_id')}) except Exception as e: return JsonResponse({"message": e.message}, status=500) run_id = data_json.get('_id')
def closerun(request): data_json = request.body try: WorkInProgress.close_run(data_json) return JsonResponse({ "message": "closed run", "_id": data_json.get('_id') }) except Exception as e: return JsonResponse({"message": e.message}, status=500) run_id = data_json.get('_id')
def submitrequest(request): data_json = request.body try: request_submission = RequestSubmission.create(data_json) logger.info('Created request submission %s' % request_submission._id) except Exception as e: logger.error('Failed to create request submission with data "%s". %s' % (data_json, e.message)) return JsonResponse({"message": e.message}, status=400) try: WorkInProgress.submit_new_request(request_submission.to_obj()) return JsonResponse({"message": "created new %s" % request_submission.get_name(), "_id": str(request_submission._id)}, status=201) except Exception as e: return JsonResponse({"message": e.message}, status=500)
def submitresult(request): data_json = request.body try: result = WorkInProgress.submit_result(data_json) return JsonResponse({"message": "created new %s" % result.get_name(), "_id": str(result._id)}, status=201) except Exception as e: return JsonResponse({"message": e.message}, status=500)
def submitrequest(request): data_json = request.body try: request_submission = RequestSubmission.create(data_json) logger.info('Created request submission %s' % request_submission._id) except Exception as e: logger.error('Failed to create request submission with data "%s". %s' % (data_json, e.message)) return JsonResponse({"message": e.message}, status=400) try: WorkInProgress.submit_new_request(request_submission.to_obj()) return JsonResponse( { "message": "created new %s" % request_submission.get_name(), "_id": str(request_submission._id) }, status=201) except Exception as e: return JsonResponse({"message": e.message}, status=500)
def submitresult(request): data_json = request.body try: result = WorkInProgress.submit_result(data_json) return JsonResponse( { "message": "created new %s" % result.get_name(), "_id": str(result._id) }, status=201) except Exception as e: return JsonResponse({"message": e.message}, status=500)
def handle(self, *args, **options): WorkInProgress.update_and_dry_run()