🩹(backend) fix client_id retrieval from request.auth

request.auth is a dict, not an object, so the getattr call was
failing when trying to retrieve client_id. Access it as a dict key
instead.
This commit is contained in:
lebaudantoine
2026-07-01 18:53:55 +02:00
committed by aleb_the_flash
parent 9ba97fd14f
commit d2bfbee389
2 changed files with 14 additions and 2 deletions
+3 -1
View File
@@ -194,10 +194,12 @@ class RoomViewSet(
role=models.RoleChoices.OWNER,
)
client_id = (self.request.auth or {}).get("client_id", "unknown")
# Log for auditing
logger.info(
"Room created via application: room_id=%s, user_id=%s, client_id=%s",
room.id,
self.request.user.id,
getattr(self.request.auth, "client_id", "unknown"),
client_id,
)