Browse Source

ref: fix annotation for user (#75245)

once mypy can follow foreign keys properly it realizes the assignment
below is incompatible

<!-- Describe your PR here. -->
anthony sottile 7 months ago
parent
commit
c489eba4a9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sentry/api/authentication.py

+ 1 - 1
src/sentry/api/authentication.py

@@ -404,7 +404,7 @@ class UserAuthTokenAuthentication(StandardAuthentication):
         return not token_str.startswith(SENTRY_ORG_AUTH_TOKEN_PREFIX)
 
     def authenticate_token(self, request: Request, token_str: str) -> tuple[Any, Any]:
-        user: AnonymousUser | RpcUser | None = AnonymousUser()
+        user: AnonymousUser | User | RpcUser | None = AnonymousUser()
 
         token: SystemToken | ApiTokenReplica | ApiToken | None = SystemToken.from_request(
             request, token_str