From 166c233b2a743a98a894fff22206c20c54eabd8e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 17 Apr 2024 14:31:37 -0700 Subject: [PATCH] default_settings: Weaken CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an import cycle that breaks mypy inference with django-stubs: zproject.settings → zproject.configured_settings → zproject.default_settings → zerver.models.users → django.conf → zproject.settings (The Django settings system is really not an appropriate place to put functions.) Signed-off-by: Anders Kaseorg --- zproject/default_settings.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zproject/default_settings.py b/zproject/default_settings.py index edc02eff8f..ac98654c67 100644 --- a/zproject/default_settings.py +++ b/zproject/default_settings.py @@ -12,8 +12,6 @@ from .config import DEVELOPMENT, PRODUCTION, get_secret if TYPE_CHECKING: from django_auth_ldap.config import LDAPSearch - from zerver.models.users import UserProfile - if PRODUCTION: # nocoverage from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR else: @@ -634,4 +632,4 @@ CAN_ACCESS_ALL_USERS_GROUP_LIMITS_PRESENCE = False # in some places through the codebase. SIGNED_ACCESS_TOKEN_VALIDITY_IN_SECONDS = 60 -CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION: Optional[Callable[..., Optional["UserProfile"]]] = None +CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION: Optional[Callable[..., Any]] = None