Skip to content

Commit 8f01ee9

Browse files
committed
Fixed a very annoying settings password issue
1 parent e6b964c commit 8f01ee9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/FreeGPT4_Server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def save_settings(request, file):
295295
c.execute("UPDATE settings SET system_prompt = ?", (request.form["system_prompt"],))
296296
c.execute("UPDATE settings SET message_history = ?", (bool(request.form["message_history"] == "true"),))
297297
c.execute("UPDATE settings SET proxies = ?", (bool(request.form["proxies"] == "true"),))
298-
c.execute("UPDATE settings SET password = ?", (generate_password_hash(request.form["new_password"]),))
298+
if (len(request.form["new_password"]) > 0):
299+
c.execute("UPDATE settings SET password = ?", (generate_password_hash(request.form["new_password"]),))
299300

300301
file = request.files["cookie_file"]
301302
if (args.private_mode or bool(request.form["private_mode"] == "true")):
@@ -534,4 +535,4 @@ async def get_token():
534535

535536
if __name__ == "__main__":
536537
# Starts the server, change the port if needed
537-
app.run("0.0.0.0", port=args.port, debug=True)
538+
app.run("0.0.0.0", port=args.port, debug=False)

0 commit comments

Comments
 (0)