From 13b4de6d82e0a9c9553a62eb8902cd8a6a992264 Mon Sep 17 00:00:00 2001 From: binarybeach Date: Sun, 3 May 2026 21:18:49 -1000 Subject: [PATCH] =?UTF-8?q?binarybeachio:=20trusted=20view=20=E2=80=94=20r?= =?UTF-8?q?ename=20log=20extra=20key=20'created'=20to=20'is=5Fsignup'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LogRecord has a built-in `created` attribute (timestamp) and Python's Logger.makeRecord raises KeyError("Attempt to overwrite 'created' in LogRecord") when extra= contains it. The 500 fired AFTER user_login already set the sessionid, so users were technically signed in but saw a 500 page on first visit. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/api/plane/authentication/views/app/trusted.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/plane/authentication/views/app/trusted.py b/apps/api/plane/authentication/views/app/trusted.py index 4fa611c98..e36235fb1 100644 --- a/apps/api/plane/authentication/views/app/trusted.py +++ b/apps/api/plane/authentication/views/app/trusted.py @@ -250,6 +250,10 @@ class TrustedSignInEndpoint(View): # Set Django session cookie via the existing helper. user_login(request=request, user=user, is_app=True) + # NOTE: do NOT name extra keys after LogRecord built-in attributes + # (`name`, `created`, `levelname`, `module`, `message`, etc.) — + # Logger.makeRecord raises KeyError("Attempt to overwrite %r in LogRecord") + # on collision. Use is_signup instead of created. log.info( "trusted-jwt sign-in", extra={ @@ -257,7 +261,7 @@ class TrustedSignInEndpoint(View): "sub": claims.get("sub"), "email": email, "tenant": claims.get("tenant"), - "created": created, + "is_signup": created, }, )