From 9be9c963266c2649597b0c9e7ce5f29958fa3341 Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Wed, 6 Nov 2024 17:08:05 +0100 Subject: [PATCH] Django: Fix: Improve db coherence on user sync issues --- .../cloudharness-django/cloudharness_django/services/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/services/user.py b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/services/user.py index 4aa0677c..189e6516 100644 --- a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/services/user.py +++ b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/services/user.py @@ -100,7 +100,7 @@ def sync_kc_user(self, kc_user, is_superuser=False, delete=False): user, created = User.objects.get_or_create(username=kc_user["username"]) - member = Member.objects.get_or_create(user=user) + member, created = Member.objects.get_or_create(user=user) member.kc_id = kc_user["id"] member.save() user = self._map_kc_user(user, kc_user, is_superuser, delete)