Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annotation for request.auser #2108

Merged
merged 2 commits into from
May 2, 2024

Conversation

bshelkhonov
Copy link
Contributor

I have made things!

Previously type tests failed on function like this because request.auser was annotated incorrectly. I fixed this.

async def get_user_async(request: HttpRequest) -> AbstractBaseUser | AnonymousUser:
    return await request.auser()

@@ -106,3 +106,15 @@
reveal_type(req.GET) # N: Revealed type is "django.http.request._ImmutableQueryDict"
req.GET['foo'] = 'bar' # E: This QueryDict is immutable. [misc]
x = 1 # E: Statement is unreachable [unreachable]

- case: request_user_auser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for it, but I don't think we need this test. The change is simple enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i see my test broke the pipeline. I removed test

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sobolevn sobolevn merged commit ea8e425 into typeddjango:master May 2, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants