File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ def get_data(self):
2525class RoleSettingRequestSerializer (serializers .Serializer ):
2626 role_id = serializers .CharField (required = True , label = _ ('Role ID' ))
2727 workspace_ids = serializers .ListField (
28- child = serializers .CharField (required = True ),
29- required = True ,
28+ child = serializers .CharField (required = False ),
29+ required = False ,
3030 label = _ ('Workspace IDs' )
3131 )
3232
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def login(instance):
106106
107107 if is_license_valid :
108108 # 检查账户是否被锁定
109- if LoginSerializer ._is_account_locked (username ):
109+ if LoginSerializer ._is_account_locked (username , failed_attempts ):
110110 raise AppApiException (
111111 1005 ,
112112 _ ("This account has been locked for %s minutes, please try again later" ) % lock_time
@@ -146,8 +146,10 @@ def login(instance):
146146 return {'token' : token }
147147
148148 @staticmethod
149- def _is_account_locked (username : str ) -> bool :
149+ def _is_account_locked (username : str , failed_attempts : int ) -> bool :
150150 """检查账户是否被锁定"""
151+ if failed_attempts == - 1 :
152+ return False
151153 lock_cache = cache .get (system_get_key (f'system_{ username } _lock' ), version = system_version )
152154 return bool (lock_cache )
153155
You can’t perform that action at this time.
0 commit comments