Skip to content

Commit

Permalink
fix(backend): 修复user_maker的调用顺序 TencentBlueKing#6691
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Sep 5, 2024
1 parent 5b8a63d commit d490302
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbm-ui/backend/bk_web/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ class JWTUserModelBackend(UserModelBackend):

def __init__(self):
super().__init__()
self.user_maker = self.jwt_user_maker

@staticmethod
def user_maker(username):
def jwt_user_maker(username):
user_model = get_user_model()
if hasattr(user_model.objects, "get_by_natural_key"):
_user_maker = user_model.objects.get_by_natural_key # type: ignore
Expand Down

0 comments on commit d490302

Please sign in to comment.