Commit 09a74000 authored by Herman Andersen Dyrkorn's avatar Herman Andersen Dyrkorn
Browse files

fix bug for rematching salamanders

parent c738d482
......@@ -218,7 +218,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
os.rmdir(salamander_path)
db.session.delete(salamander)
db.session.commit()
if match_bool:
if match_bool and result > -1:
return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else:
return jsonify(
......@@ -236,7 +236,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
db.session.commit()
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:
if match_bool and result > -1:
return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else:
return jsonify(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment