bugfix server

This commit is contained in:
iou1name 2019-06-02 20:28:30 -04:00
parent 94fa825e67
commit 4be501016c

View File

@ -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):
"""