Skip to content

Commit 0117348

Browse files
authored
Rename SuccessURLAllowedHostsMixin to RedirectURLMixin and hint missing attributes (#1641)
Remove SuccessURLAllowedHostsMixin and replace it with 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."
1 parent 181bc0c commit 0117348

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

django-stubs/contrib/auth/views.pyi

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ from django.views.generic.edit import FormView
99

1010
UserModel: Any
1111

12-
class SuccessURLAllowedHostsMixin:
13-
success_url_allowed_hosts: Any
12+
class RedirectURLMixin:
13+
next_page: str | None
14+
redirect_field_name: str
15+
success_url_allowed_hosts: set[str]
16+
def get_success_url(self) -> str: ...
17+
def get_redirect_url(self) -> str: ...
1418
def get_success_url_allowed_hosts(self) -> set[str]: ...
19+
def get_default_redirect_url(self) -> str: ...
1520

16-
class LoginView(SuccessURLAllowedHostsMixin, FormView[AuthenticationForm]):
21+
class LoginView(RedirectURLMixin, FormView[AuthenticationForm]):
1722
authentication_form: Any
1823
redirect_field_name: Any
1924
redirect_authenticated_user: bool
2025
extra_context: Any
2126
def get_redirect_url(self) -> str: ...
2227

23-
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
28+
class LogoutView(RedirectURLMixin, TemplateView):
2429
next_page: str | None
2530
redirect_field_name: str
2631
extra_context: Any

scripts/stubtest/allowlist_todo.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,10 @@ django.contrib.auth.validators.UnicodeUsernameValidator.__new__
237237
django.contrib.auth.validators.UnicodeUsernameValidator.deconstruct
238238
django.contrib.auth.views.INTERNAL_RESET_URL_TOKEN
239239
django.contrib.auth.views.LoginView.form_class
240-
django.contrib.auth.views.LoginView.get_default_redirect_url
241-
django.contrib.auth.views.LogoutView.get_default_redirect_url
242240
django.contrib.auth.views.LogoutView.get_next_page
243241
django.contrib.auth.views.PasswordChangeView.form_class
244242
django.contrib.auth.views.PasswordResetConfirmView.form_class
245243
django.contrib.auth.views.PasswordResetView.form_class
246-
django.contrib.auth.views.RedirectURLMixin
247-
django.contrib.auth.views.SuccessURLAllowedHostsMixin
248244
django.contrib.contenttypes.admin.GenericInlineModelAdmin
249245
django.contrib.contenttypes.admin.GenericInlineModelAdmin.ct_field
250246
django.contrib.contenttypes.admin.GenericInlineModelAdmin.ct_fk_field

0 commit comments

Comments
 (0)