Exemple #1
0
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')
Exemple #2
0
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')
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
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)
Exemple #7
0
 def handle(self, *args, **options):
     WorkInProgress.update_and_dry_run()
Exemple #8
0
 def handle(self, *args, **options):
     WorkInProgress.update_and_dry_run()