Skip to content
Snippets Groups Projects
Commit 09a74000 authored by Herman Andersen Dyrkorn's avatar Herman Andersen Dyrkorn
Browse files

fix bug for rematching salamanders

parent c738d482
Branches
No related tags found
1 merge request!49Resolve "re-match"
...@@ -218,7 +218,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las ...@@ -218,7 +218,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
os.rmdir(salamander_path) os.rmdir(salamander_path)
db.session.delete(salamander) db.session.delete(salamander)
db.session.commit() db.session.commit()
if match_bool: if match_bool and result > -1:
return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200}) return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else: else:
return jsonify( return jsonify(
...@@ -236,7 +236,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las ...@@ -236,7 +236,7 @@ def handle_remaining_images(salamander, salamander_path: str, image_id: int, las
db.session.commit() db.session.commit()
os.rename(processed_path, os.path.join(salamander_path, str(image_id) + "_str" + processed_extension)) 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)) 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}) return jsonify({"id": result, "matching": "Match!", "message": "Matched with salamander", 'status': 200})
else: else:
return jsonify( return jsonify(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment