From e8baa6c9ab8b4b885cad96f4721afda3f133e7d4 Mon Sep 17 00:00:00 2001 From: Bradley Kirton Date: Thu, 22 Aug 2024 13:47:54 +0200 Subject: [PATCH 1/2] feat: Add missing stubs Add stubs for django.contrib.auth.decorators::login_not_required --- django-stubs/contrib/auth/decorators.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/django-stubs/contrib/auth/decorators.pyi b/django-stubs/contrib/auth/decorators.pyi index 7fcbe5257..a17f5bd45 100644 --- a/django-stubs/contrib/auth/decorators.pyi +++ b/django-stubs/contrib/auth/decorators.pyi @@ -18,6 +18,7 @@ def user_passes_test( def login_required(redirect_field_name: str | None = ..., login_url: str | None = ...) -> Callable[[_VIEW], _VIEW]: ... @overload def login_required(function: _VIEW, redirect_field_name: str | None = ..., login_url: str | None = ...) -> _VIEW: ... +def login_not_required(view_func: _VIEW) -> _VIEW: ... def permission_required( perm: Iterable[str] | str, login_url: str | None = ..., raise_exception: bool = ... ) -> Callable[[_VIEW], _VIEW]: ... From 83f983ad8dca1a5baa2cfa77a331ab5ff5964050 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 22 Aug 2024 17:56:00 +0300 Subject: [PATCH 2/2] Update allowlist_todo_django51.txt --- scripts/stubtest/allowlist_todo_django51.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/stubtest/allowlist_todo_django51.txt b/scripts/stubtest/allowlist_todo_django51.txt index 84fa424ae..b64905951 100644 --- a/scripts/stubtest/allowlist_todo_django51.txt +++ b/scripts/stubtest/allowlist_todo_django51.txt @@ -12,7 +12,6 @@ django.contrib.admin.models.LogEntryManager.log_actions django.contrib.admin.options.ModelAdmin.log_deletions django.contrib.auth.base_user.BaseUserManager.make_random_password django.contrib.auth.checks.check_middleware -django.contrib.auth.decorators.login_not_required django.contrib.auth.forms.AdminPasswordChangeForm.clean_password2 django.contrib.auth.forms.AdminPasswordChangeForm.usable_password_help_text django.contrib.auth.forms.BaseUserCreationForm.clean_password2