diff --git a/parts/server.py b/parts/server.py index 1bc0d02..19c733e 100755 --- a/parts/server.py +++ b/parts/server.py @@ -164,7 +164,7 @@ def alterUser(userID): @app.route(baseURL+'/getpartinfo/') def get_part_info(partID): - s = 'select p.id,partno,description,notes, c.name || l.name as location_descriptor, location_id, container_id, datasheet, EXTRACT(EPOCH from now()-reported_missing) as missing_for from parts as p inner join locations as l on p.location_id = l.id inner join containers as c on l.container_id = c.id where p.id = :id;' + s = 'select p.id,partno,description,notes,EXTRACT(EPOCH from now()-reported_missing) as missing_for, c.name || l.name as location_descriptor, location_id, container_id, datasheet from parts as p inner join locations as l on p.location_id = l.id inner join containers as c on l.container_id = c.id where p.id = :id;' r = db_engine.execute(text(s), id=partID) l = [] for row in r: diff --git a/parts/static/script.js b/parts/static/script.js index ee7e4e6..4e6b16a 100755 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -149,10 +149,11 @@ function report_missing(partID, missing){ var data = new FormData(); data.append('partID', partID); if(missing){ - data.append('missing', 'missing') + missing = 'missing' }else{ - data.append('missing', 'found') + missing = 'found' } + data.append('missing', missing) $.ajax({ url: rootURL + 'report_missing', type: 'POST', @@ -161,7 +162,7 @@ function report_missing(partID, missing){ contentType: false, processData: false, success: function(data) { - alert("Thank you for reporting part as " + missing "."); + alert("Thank you for reporting part as " + missing + "."); }, error: function() { alert("Couldn't update the part information. Please retry.");