default_settings: Weaken CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION type.

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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-04-17 14:31:37 -07:00 committed by Tim Abbott
parent 73116f78a5
commit 166c233b2a
1 changed files with 1 additions and 3 deletions

View File

@ -12,8 +12,6 @@ from .config import DEVELOPMENT, PRODUCTION, get_secret
if TYPE_CHECKING: if TYPE_CHECKING:
from django_auth_ldap.config import LDAPSearch from django_auth_ldap.config import LDAPSearch
from zerver.models.users import UserProfile
if PRODUCTION: # nocoverage if PRODUCTION: # nocoverage
from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR from .prod_settings import EXTERNAL_HOST, ZULIP_ADMINISTRATOR
else: else:
@ -634,4 +632,4 @@ CAN_ACCESS_ALL_USERS_GROUP_LIMITS_PRESENCE = False
# in some places through the codebase. # in some places through the codebase.
SIGNED_ACCESS_TOKEN_VALIDITY_IN_SECONDS = 60 SIGNED_ACCESS_TOKEN_VALIDITY_IN_SECONDS = 60
CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION: Optional[Callable[..., Optional["UserProfile"]]] = None CUSTOM_AUTHENTICATION_WRAPPER_FUNCTION: Optional[Callable[..., Any]] = None