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

Rename SuccessURLAllowedHostsMixin to RedirectURLMixin and hint missing attributes #1641

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

si14
Copy link
Contributor

@si14 si14 commented Aug 3, 2023

Just a simple stub for contrib.auth.views.RedirectURLMixin.

I noticed that it was in the todolist and I needed it, so here it is.

def get_redirect_url(self) -> str: ...
def get_success_url_allowed_hosts(self) -> set[str]: ...
def get_default_redirect_url(self) -> str: ...

class SuccessURLAllowedHostsMixin:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some more changes look warranted...

SuccessURLAllowedHostsMixin no longer exists in Django 4.2, LoginView and LogoutView should inherit from RedirectURLMixin instead.

@intgr intgr changed the title add a stub for RedirectURLMixin Add RedirectURLMixin Aug 3, 2023
@intgr intgr self-assigned this Aug 3, 2023
Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Please remove SuccessURLAllowedHostsMixin and replace it with the new RedirectURLMixin.

Per Django 4.1 release notes
(https://docs.djangoproject.com/en/4.2/releases/4.1/#miscellaneous):

"The undocumented django.contrib.auth.views.SuccessURLAllowedHostsMixin
mixin is replaced by RedirectURLMixin."
@si14 si14 force-pushed the new-stub-redirecturlmixin branch from 2b408dc to d7cd899 Compare August 23, 2023 15:02
@si14
Copy link
Contributor Author

si14 commented Aug 23, 2023

@intgr fixed, all tests are green

Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

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

Thank you!

@intgr intgr changed the title Add RedirectURLMixin Rename SuccessURLAllowedHostsMixin to RedirectURLMixin and hint missing attributes Aug 23, 2023
@intgr intgr merged commit 0117348 into typeddjango:master Aug 23, 2023
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