From d5ee2e92c8000a01b1d7a6502aac25f4878bbd2c Mon Sep 17 00:00:00 2001 From: Aleksandr Meshchryakov Date: Mon, 28 Sep 2026 14:06:14 +0200 Subject: [PATCH] Lock SSO identity without locking nullable profile join --- src/apps/user/sso_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- 2.39.5