Skip to content
Snippets Groups Projects
Commit 4ba4cbbe authored by andmag's avatar andmag
Browse files

Added match to endpoint

parent f7e39e1c
No related tags found
No related merge requests found
......@@ -144,9 +144,10 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
db.session.delete(salamander)
db.session.commit()
if match_bool:
return jsonify({"id": result, "matching": "Yes", 'status': 200})
return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else:
return jsonify({"id": salamander.id, "matching": "No", 'status': 200})
return jsonify(
{"id": salamander.id, "matching": "No match.", "message": "New salamander in database", 'status': 200})
else:
if image_id != last_id:
......@@ -161,9 +162,10 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
os.rename(processed_path, os.path.join(salamander_path, str(image_id) + "_str" + processed_extension))
os.rename(original_path, os.path.join(salamander_path, str(image_id) + original_extension))
if match_bool:
return jsonify({"id": result, "matching": "Yes", 'status': 200})
return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else:
return jsonify({"id": salamander.id, "matching": "No", 'status': 200})
return jsonify(
{"id": salamander.id, "matching": "No match.", "message": "New salamander in database", 'status': 200})
def lower_image_id_growth_row(salamander_id, old_id, new_id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment