Skip to content

Commit d883d0f

Browse files
committed
fix: correct cache key format for login attempt tracking
1 parent 97b5847 commit d883d0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/users/serializers/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def chat_generate(username: str, type: str = 'chat', access_token: str = ''):
168168
if max_attempts == -1:
169169
need_captcha = False
170170
elif max_attempts > 0:
171-
fail_count = cache.get(system_get_key(f'system_{username}'), version=system_version) or 0
171+
fail_count = cache.get(system_get_key(f'{type}_{username}'), version=system_version) or 0
172172
need_captcha = fail_count >= max_attempts
173173

174174

0 commit comments

Comments
 (0)