From dabc9eb09bb07be0a2b62b91e37505b96f3d1e0b Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 18 Jun 2021 18:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E8=AE=A4=E8=AF=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=97=B6username=E7=9A=84=E9=80=89=E6=8B=A9=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=EF=BC=88=E5=8D=95=E7=8B=AC=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E7=9A=84=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E4=BF=A1=E6=81=AF=E7=99=BB=E5=BD=95=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/models/user.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index b64aeb758..384272af7 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -248,13 +248,16 @@ class SystemUser(BaseUser): if user_id: user = get_object_or_none(User, pk=user_id) + _username = self.username if self.username_same_with_user: if user and not username: - username = user.username + _username = user.username + else: + _username = username # 加载某个资产的特殊配置认证信息 try: - self.load_asset_special_auth(asset, username) + self.load_asset_special_auth(asset, _username) except Exception as e: logger.error('Load special auth Error: ', e) pass