diff --git a/server.py b/server.py index 8438c44..c996a09 100644 --- a/server.py +++ b/server.py @@ -66,7 +66,8 @@ def alter(partID): file = request.files['file'] filename = secure_filename(file.filename) file.save(os.path.join('/srv/datasheets', filename))''' - print dict(request) + print dict(request.data) + print dict(request.files) def connect(user, password, db, host='localhost', port=5432): '''Returns a connection and a metadata object''' diff --git a/static/script.js b/static/script.js index d34e54b..53b1fe6 100644 --- a/static/script.js +++ b/static/script.js @@ -83,11 +83,11 @@ function save(partID) { var quantity_v = $('#quantity-input').val(); var notes_v = $('#notes-input').val(); var datasheet = $('#datasheet-input')[0].files; - if(! partno.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) { + if(! partno_v.match(/^([a-zA-Z0-9]+\s*){1,3}$/g)) { alert('Invalid part number format. Accepted: '); return; } - if(! block.match(/^[0-9]+$/g)) { + if(! block_v.match(/^[0-9]+$/g)) { alert('Invalid location field. Only numbers accepted.'); return; } @@ -153,7 +153,7 @@ function show_part_info(partID) { $('#datasheet-info').text(''); else $('#datasheet-info').text(' '); - $('#edit-button').on('click', function() { + $('#edit-button').click(function() { init_edit(partID); }); overlay_in(); diff --git a/templates/partsearch.html b/templates/partsearch.html index ee6a4c0..89fba24 100644 --- a/templates/partsearch.html +++ b/templates/partsearch.html @@ -68,7 +68,7 @@

-
+