From 9f3719092919e0d4d66a97a5a537a10997dc4a61 Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 14 May 2026 12:12:01 +0530 Subject: [PATCH 1/2] fix: improve logging for user sync errors in _get_user function --- .../cloudharness-django/cloudharness_django/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/middleware.py b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/middleware.py index be5e33fd..53e5d04a 100644 --- a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/middleware.py +++ b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/middleware.py @@ -102,7 +102,7 @@ def _get_user(kc_user_id: str) -> User: return user except Exception as e: - log.exception("User sync error, %s", kc_user.email) + log.exception("User sync error for kc_id %s", kc_user_id) return None return user From 2f02052ac4bc7c9cb37cc412ab7207aac47fe37e Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 14 May 2026 12:24:46 +0530 Subject: [PATCH 2/2] fix: fix formating with autopep in keycloak.py --- libraries/cloudharness-common/cloudharness/auth/keycloak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cloudharness-common/cloudharness/auth/keycloak.py b/libraries/cloudharness-common/cloudharness/auth/keycloak.py index d925b1b9..7c5c6d6b 100644 --- a/libraries/cloudharness-common/cloudharness/auth/keycloak.py +++ b/libraries/cloudharness-common/cloudharness/auth/keycloak.py @@ -118,7 +118,7 @@ def _get_public_key_cache_path(): from django.conf import settings return os.path.join(settings.PERSISTENT_ROOT, "cloudharness_public_key") except ImportError: - return "/tmp/cloudharness_public_key" + return "/tmp/cloudharness_public_key" except Exception: log.exception("Could not get Django settings, using /tmp for public key cache") return "/tmp/cloudharness_public_key"