fix: account has no owner workspace by member inviting (#2435)

This commit is contained in:
takatost
2024-02-12 02:09:01 +08:00
committed by GitHub
parent 9232244920
commit e6d22fc3a0
4 changed files with 47 additions and 30 deletions

View File

@@ -7,7 +7,7 @@ from controllers.console import api
from controllers.console.setup import setup_required
from libs.helper import email
from libs.password import valid_password
from services.account_service import AccountService
from services.account_service import AccountService, TenantService
class LoginApi(Resource):
@@ -29,6 +29,8 @@ class LoginApi(Resource):
except services.errors.account.AccountLoginError:
return {'code': 'unauthorized', 'message': 'Invalid email or password'}, 401
TenantService.create_owner_tenant_if_not_exist(account)
AccountService.update_last_login(account, request)
# todo: return the user info