Skip to content

Refs #31223 -- Added __class_getitem__() to SetPasswordMixin and UnusablePasswordMixin #19638

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UnknownPlatypus
Copy link
Contributor

Trac ticket number

Refs ticket-31223

Branch description

This is similar to #12405 and #15571.

We are struggling to monkeypatch these in django-stubs because this module import the User model.

This is quite valuable because users want to declare their custom User model when using these forms (for ex SetPasswordForm[MyUser]) to have accurate types.

See related issue in django-stubs and associated mitigation PR

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

@UnknownPlatypus
Copy link
Contributor Author

cc @adamchainz , would be awesome if you could have a look 🙌

Copy link
Member

@adamchainz adamchainz left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think at this point we shouldn't shy away from adding __class__getitem__ wherever needed by Django-stubs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants