Exemplo n.º 1
0
 def single_reply(source_uuid, reply_uuid):
     get_or_404(Source, source_uuid, column=Source.uuid)
     reply = get_or_404(Reply, reply_uuid, column=Reply.uuid)
     if request.method == 'GET':
         return jsonify(reply.to_json()), 200
     elif request.method == 'DELETE':
         utils.delete_file_object(reply)
         return jsonify({'message': 'Reply deleted'}), 200
Exemplo n.º 2
0
 def single_submission(source_uuid, submission_uuid):
     if request.method == 'GET':
         get_or_404(Source, source_uuid, column=Source.uuid)
         submission = get_or_404(Submission, submission_uuid, column=Submission.uuid)
         return jsonify(submission.to_json()), 200
     elif request.method == 'DELETE':
         get_or_404(Source, source_uuid, column=Source.uuid)
         submission = get_or_404(Submission, submission_uuid, column=Submission.uuid)
         utils.delete_file_object(submission)
         return jsonify({'message': 'Submission deleted'}), 200
Exemplo n.º 3
0
 def single_reply(source_uuid: str,
                  reply_uuid: str) -> Tuple[flask.Response, int]:
     get_or_404(Source, source_uuid, column=Source.uuid)
     reply = get_or_404(Reply, reply_uuid, column=Reply.uuid)
     if request.method == 'GET':
         return jsonify(reply.to_json()), 200
     elif request.method == 'DELETE':
         utils.delete_file_object(reply)
         return jsonify({'message': 'Reply deleted'}), 200
     else:
         abort(405)
Exemplo n.º 4
0
 def single_submission(source_uuid: str,
                       submission_uuid: str) -> Tuple[flask.Response, int]:
     if request.method == 'GET':
         get_or_404(Source, source_uuid, column=Source.uuid)
         submission = get_or_404(Submission,
                                 submission_uuid,
                                 column=Submission.uuid)
         return jsonify(submission.to_json()), 200
     elif request.method == 'DELETE':
         get_or_404(Source, source_uuid, column=Source.uuid)
         submission = get_or_404(Submission,
                                 submission_uuid,
                                 column=Submission.uuid)
         utils.delete_file_object(submission)
         return jsonify({'message': 'Submission deleted'}), 200
     else:
         abort(405)