Skip to content

Conversation

@ziima
Copy link
Contributor

@ziima ziima commented Oct 16, 2025

Allow auth to be set to an empty sequence and act as if it was set to None.

@vitalik
Copy link
Owner

vitalik commented Oct 16, 2025

what actually happens when you set empty list (before applying this patch)

@ziima
Copy link
Contributor Author

ziima commented Oct 17, 2025

It produces TypeError on access to the view:

    def _run_authentication(self, request: HttpRequest) -> Optional[HttpResponse]:
        for callback in self.auth_callbacks:
            try:
                if is_async_callable(callback) or getattr(callback, "is_async", False):
                    result = callback(request)
                    if inspect.iscoroutine(result):
                        result = async_to_sync(callback)(request)
                else:
>                   result = callback(request)
                             ^^^^^^^^^^^^^^^^^
E                   TypeError: 'list' object is not callable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants