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

feat: Add missing stubs #2348

Merged
merged 2 commits into from
Aug 22, 2024
Merged

feat: Add missing stubs #2348

merged 2 commits into from
Aug 22, 2024

Conversation

BradleyKirton
Copy link
Contributor

This PR adds stubs for login_not_required which is new in django 5.1 and the _unicode_ci_compare function in the django.contrib.auth.forms module.

@@ -15,6 +15,8 @@ from typing_extensions import TypeAlias
UserModel: TypeAlias = type[_UserModel]
_User = TypeVar("_User", bound=AbstractBaseUser)

def _unicode_ci_compare(s1: str, s2: str) -> bool: ...
Copy link
Member

Choose a reason for hiding this comment

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

We generally tend to ignore protected names in stubs. Can you please explain the use-case for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi 👋

I made use of that function in a project and noticed the type information was missing in my editor.

I did consider just copying the function into my code given it is so small.

I can amend the commit without this stub if you like.

Copy link
Member

Choose a reason for hiding this comment

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

yes, please :)

Add stubs for django.contrib.auth.decorators::login_not_required
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 2dfa15b into typeddjango:master Aug 22, 2024
36 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