From b297462d3bb3ce3e9824968f446fd281808e345d Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Tue, 13 Nov 2018 21:58:38 +0100 Subject: [PATCH] fixed location editor --- parts/server.py | 2 +- parts/static/locationEditorScript.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/parts/server.py b/parts/server.py index 8dc168d..be17928 100644 --- a/parts/server.py +++ b/parts/server.py @@ -106,7 +106,7 @@ def alterLocation(locationID): if locationID < 0: # New entry s = 'insert into locations (name, container_id) ' - s += 'values (:name, :container, :userid);' + s += 'values (:name, :container);' s = text(s) r = db_engine.execute(s,name=request.form['name'],container=request.form['container']); r.close() diff --git a/parts/static/locationEditorScript.js b/parts/static/locationEditorScript.js index c8c5c0b..357213f 100644 --- a/parts/static/locationEditorScript.js +++ b/parts/static/locationEditorScript.js @@ -55,11 +55,13 @@ function saveLocation(locationID) { function deleteLocation(locationID) { - if (locationID < 0) + if (locationID < 0){ alert('Congratulations! You found the secret UI bug easter egg! This button should not be here, yet I left it specifically because I wanted an easter egg and not because of any other reasons! Good for you!') return; - if (!confirm('Delete the selected location? If there are parts there, this will leave a mess in the database and Marek will be very sad.')) + } + if (!confirm('Delete the selected location? If there are parts there, this will leave a mess in the database and Marek will be very sad.')){ return; + } $.ajax({ url: rootURL + 'deleteLocation/' + locationID, type: 'GET',