diff --git a/overwrought_server.py b/overwrought_server.py index ad6b0f6..90ca0e8 100755 --- a/overwrought_server.py +++ b/overwrought_server.py @@ -47,7 +47,7 @@ def get(): """ app.config.get('db_lock').acquire() con = sqlite3.connect('modpack.db') - cur = sqlite3.cursor() + cur = con.cursor() mods = cur.execute('SELECT filename FROM mod').fetchall() app.config.get('db_lock').release() @@ -65,20 +65,21 @@ def post(): abort(401) files = request.files.to_dict() - if 'modpack.db' in files: - db = request.files.get('database') + if 'modpack.db' in files.keys(): + db = request.files.get('modpack.db') app.config.get('db_lock').acquire() db.save('modpack.db') app.config.get('db_lock').release() files.pop('modpack.db') - if config_server.modpack_name + '.html' in files: + if config_server.modpack_name + '.html' in files.keys(): summary = request.files.get(config_server.modpack_name + '.html') summary.save(config_server.modpack_name + '.html') files.pop(config_server.modpack_name + '.html') for fname, file in files.items(): file.save(os.path.join(config_server.mods_dir, fname)) + return "Success!" def generate_hash(password): """