From 44db2218c1636291f00dabba9e04fad965a783d6 Mon Sep 17 00:00:00 2001 From: Awoodwhale Date: Tue, 21 Mar 2023 12:45:57 +0800 Subject: [PATCH] fix: Use better conditional judgment methods --- app/admin_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin_service.py b/app/admin_service.py index 2893434..95e9d8b 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -116,5 +116,5 @@ def get_users(): def update_user_password(username, password="123456"): with db_session: user = User.select(name=username) - if user and user.first(): + if user: user.first().password = md5(username + password)