Skip to content

Commit

Permalink
Merge pull request #350 from wklken/fix_auth_login_exception
Browse files Browse the repository at this point in the history
fix(login): fix auth_login raise exception in some conditions
  • Loading branch information
wklken authored Apr 7, 2022
2 parents f26358c + 05e672e commit 1194555
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions deploy/helm/bk-user/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: bk-user
description: A Helm chart for bk-user
type: application
version: 1.2.0
appVersion: "v2.3.4-beta.6"
version: 1.2.1
appVersion: "v2.3.4-beta.8"

dependencies:

Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: api
description: Api module for bk-user
type: application
version: 1.0.0
appVersion: "v2.3.4-beta.6"
appVersion: "v2.3.4-beta.8"
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ image:
registry: hub.bktencent.com
repository: blueking/bk-user-api
pullPolicy: IfNotPresent
tag: "v2.3.4-beta.6"
tag: "v2.3.4-beta.8"

nameOverride: ""
fullnameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/login/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: login
description: login module for blueking
type: application
version: 1.0.0
appVersion: "v2.3.4-beta.6"
appVersion: "v2.3.4-beta.8"
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/login/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ image:
registry: hub.bktencent.com
repository: blueking/bk-login
pullPolicy: IfNotPresent
tag: "v2.3.4-beta.6"
tag: "v2.3.4-beta.8"

nameOverride: ""
fullnameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/saas/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: saas
description: SaaS module for bk-user
type: application
version: 1.0.0
appVersion: "v2.3.4-beta.6"
appVersion: "v2.3.4-beta.8"
2 changes: 1 addition & 1 deletion deploy/helm/bk-user/charts/saas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ image:
registry: hub.bktencent.com
repository: blueking/bk-user-saas
pullPolicy: IfNotPresent
tag: "v2.3.4-beta.6"
tag: "v2.3.4-beta.8"

command: []
args: []
Expand Down
8 changes: 7 additions & 1 deletion src/login/bklogin/bkauth/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ def login_success_response(request, user_or_form, redirect_to, app_id):

# 设置用户登录
# TODO: 这个是django默认的login函数, 调用如果报错可以注解, 目前无实际作用
auth_login(request, user)
try:
auth_login(request, user)
except Exception: # pylint: disable=broad-except
# will raise django.db.utils.DatabaseError: Save with update_fields did not affect any rows.
# while auth_login at the final step user_logged_in.send, but it DO NOT MATTERS!
logger.debug("auth_login fail", exec_info=True)

# 记录登录日志
record_login_log(request, username, app_id)

Expand Down

0 comments on commit 1194555

Please sign in to comment.