Skip to content
Snippets Groups Projects
Commit 9fd496e4 authored by Eirik Martin Danielsen's avatar Eirik Martin Danielsen :speech_balloon:
Browse files

moved db.commit

parent 39b8284f
Branches
No related tags found
1 merge request!38Resolve "remove dead code and cleanup"
......@@ -88,10 +88,10 @@ class LocationEndpoint(Resource):
if not os.path.isdir(new_path):
os.rename(folder_path, new_path)
location.name = data['new_name'].lower()
db.session.commit()
return jsonify({"message": "location updated", "status": 200})
else:
return jsonify({"message": "location folder was not found", "status": 400})
db.session.commit()
return jsonify({"location": location.id, "status": 200})
else:
return jsonify({"message": "location doesn't exist", "status": 400})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment