Commit 66261209 authored by Eirik Martin Danielsen's avatar Eirik Martin Danielsen 💬
Browse files

remove directory as well

parent 2a100411
......@@ -58,6 +58,7 @@ class LocationEndpoint(Resource):
if location:
db.session.delete(location)
db.session.commit()
os.rmdir(os.path.abspath("./images/" + location.name))
return jsonify({"message": location.name + " deleted.", "status": 200})
else:
return jsonify({"message": "location doesn't exist", "status": 400})
......
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