Make message more clear if file is not found in create_image_from_file view and added gunicorn
This commit is contained in:
parent
0253aa9afc
commit
084da2eee5
3 changed files with 13 additions and 2 deletions
1
Pipfile
1
Pipfile
|
@ -12,6 +12,7 @@ requests = "*"
|
|||
flask = "*"
|
||||
flask-restful = "*"
|
||||
etcd3 = "*"
|
||||
gunicorn = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.7"
|
||||
|
|
10
Pipfile.lock
generated
10
Pipfile.lock
generated
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "8793670eeaec12ab75f38686e67ba0c4f7d27a7b6da26d9c692b55621c865f63"
|
||||
"sha256": "87f5447c7fa8d96dacc7c638075cc31842ef676f6d1c35214e1960572d44e929"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -104,6 +104,14 @@
|
|||
],
|
||||
"version": "==1.21.1"
|
||||
},
|
||||
"gunicorn": {
|
||||
"hashes": [
|
||||
"sha256:aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471",
|
||||
"sha256:fa2662097c66f920f53f70621c6c58ca4a3c4d3434205e608e121b5b3b71f4f3"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==19.9.0"
|
||||
},
|
||||
"idna": {
|
||||
"hashes": [
|
||||
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
|
||||
|
|
4
main.py
4
main.py
|
@ -101,7 +101,9 @@ class CreateImage(Resource):
|
|||
|
||||
file_entry = client.get(f"/v1/files/{image_file_uuid}")
|
||||
if file_entry is None:
|
||||
return {"Message": "Image File Not Found"}, 400
|
||||
return {
|
||||
"Message":
|
||||
f"Image File with uuid '{image_file_uuid}' Not Found"}, 400
|
||||
|
||||
file_entry_value = json.loads(file_entry.value)
|
||||
|
||||
|
|
Loading…
Reference in a new issue