diff --git a/parts/server.py b/parts/server.py index 0bdc98d..f8f6f01 100644 --- a/parts/server.py +++ b/parts/server.py @@ -254,9 +254,9 @@ def alter(partID): datasheet_file.save('/srv/datasheets/' + datasheet_filename) datasheet_filename = 'http://elab.kth.se/parts/getfile/' + datasheet_filename if l[0]['datasheet'] != None: - os.remove('/srv/datasheets/' + l[0]['datasheet']) - # elif request.form.has_key('datasheet-url'): - # datasheet_filename = request.form['datasheet-url'] + whole_url = l[0]['datasheet'] + actual_filename = whole_url[whole_url.rfind('/') + 1:] + os.remove('/srv/datasheets/' + actual_filename) else: try: datasheet_filename = request.form['datasheet-url'] diff --git a/parts/static/script.js b/parts/static/script.js index 9fc470f..ae31607 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -182,8 +182,10 @@ function show_part_info(partID) { $('tr#datasheet-head').html($('