From 6e5fd6710ca064dacb880e881a971b4e429f7796 Mon Sep 17 00:00:00 2001 From: Joe <1264204425@qq.com> Date: Fri, 27 Sep 2024 14:56:00 +0800 Subject: [PATCH] fix: query error --- api/controllers/console/auth/error.py | 4 +--- api/services/account_service.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/controllers/console/auth/error.py b/api/controllers/console/auth/error.py index aa638be135..523077867f 100644 --- a/api/controllers/console/auth/error.py +++ b/api/controllers/console/auth/error.py @@ -45,9 +45,7 @@ class EmailOrPasswordMismatchError(BaseHTTPException): class EmailPasswordLoginLimitError(BaseHTTPException): error_code = "email_code_login_limit" - description = ( - "The account was locked for 24 hours because the password was entered too many times." - ) + description = "The account was locked for 24 hours because the password was entered too many times." code = 429 diff --git a/api/services/account_service.py b/api/services/account_service.py index 7436ab22be..9762b896c2 100644 --- a/api/services/account_service.py +++ b/api/services/account_service.py @@ -183,7 +183,7 @@ class AccountService: TenantService.create_owner_tenant_if_not_exist(account=account) else: # SElF_HOST just have one tenant - tenant = Tenant.query.filter_by(id=1).first() + tenant = Tenant.query.first() TenantService.create_tenant_member(tenant, account, role="user") account.current_tenant = tenant db.session.commit()