diff --git a/src/apps/user/sso_services.py b/src/apps/user/sso_services.py index 0c46392..183d14e 100644 --- a/src/apps/user/sso_services.py +++ b/src/apps/user/sso_services.py @@ -264,7 +264,7 @@ def _ensure_user_claims_available(claims: SsoClaims, *, exclude_user_id=None) -> def provision_sso_user(claims: SsoClaims): """Создаёт или обновляет локального пользователя по неизменяемой SSO identity.""" identity = ( - SsoIdentity.objects.select_for_update() + SsoIdentity.objects.select_for_update(of=("self",)) .select_related("user", "user__profile") .filter(issuer=claims.issuer, subject=claims.subject) .first()