bugfix server
This commit is contained in:
parent
94fa825e67
commit
4be501016c
|
@ -47,7 +47,7 @@ def get():
|
||||||
"""
|
"""
|
||||||
app.config.get('db_lock').acquire()
|
app.config.get('db_lock').acquire()
|
||||||
con = sqlite3.connect('modpack.db')
|
con = sqlite3.connect('modpack.db')
|
||||||
cur = sqlite3.cursor()
|
cur = con.cursor()
|
||||||
mods = cur.execute('SELECT filename FROM mod').fetchall()
|
mods = cur.execute('SELECT filename FROM mod').fetchall()
|
||||||
app.config.get('db_lock').release()
|
app.config.get('db_lock').release()
|
||||||
|
|
||||||
|
@ -65,20 +65,21 @@ def post():
|
||||||
abort(401)
|
abort(401)
|
||||||
|
|
||||||
files = request.files.to_dict()
|
files = request.files.to_dict()
|
||||||
if 'modpack.db' in files:
|
if 'modpack.db' in files.keys():
|
||||||
db = request.files.get('database')
|
db = request.files.get('modpack.db')
|
||||||
app.config.get('db_lock').acquire()
|
app.config.get('db_lock').acquire()
|
||||||
db.save('modpack.db')
|
db.save('modpack.db')
|
||||||
app.config.get('db_lock').release()
|
app.config.get('db_lock').release()
|
||||||
files.pop('modpack.db')
|
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 = request.files.get(config_server.modpack_name + '.html')
|
||||||
summary.save(config_server.modpack_name + '.html')
|
summary.save(config_server.modpack_name + '.html')
|
||||||
files.pop(config_server.modpack_name + '.html')
|
files.pop(config_server.modpack_name + '.html')
|
||||||
|
|
||||||
for fname, file in files.items():
|
for fname, file in files.items():
|
||||||
file.save(os.path.join(config_server.mods_dir, fname))
|
file.save(os.path.join(config_server.mods_dir, fname))
|
||||||
|
return "Success!"
|
||||||
|
|
||||||
def generate_hash(password):
|
def generate_hash(password):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user