From 2dfa15bf94b038c4dae1590093981d3eacfa83e6 Mon Sep 17 00:00:00 2001 From: Bradley Stuart Kirton Date: Thu, 22 Aug 2024 17:12:17 +0200 Subject: [PATCH] feat: Add missing stubs (#2348) * feat: Add missing stubs Add stubs for django.contrib.auth.decorators::login_not_required * Update allowlist_todo_django51.txt --------- Co-authored-by: sobolevn --- django-stubs/contrib/auth/decorators.pyi | 1 + scripts/stubtest/allowlist_todo_django51.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) 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]: ... 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