diff --git a/api/endpoints/editsalamander.py b/api/endpoints/editsalamander.py index 563b9d5ac9abb78b17e61606dd7a75c4ba9b2394..50adb7fb5f8fda5c21c773e8c9f09a8644e5c7f5 100644 --- a/api/endpoints/editsalamander.py +++ b/api/endpoints/editsalamander.py @@ -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(