mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #24707 -- Improved error reporting for explicitly imported uncallable views
This commit is contained in:
@@ -94,6 +94,11 @@ def get_callable(lookup_view, can_fail=False):
|
||||
if callable(lookup_view):
|
||||
return lookup_view
|
||||
|
||||
if not isinstance(lookup_view, six.string_types):
|
||||
raise ViewDoesNotExist(
|
||||
"'%s' is not a callable or a dot-notation path" % lookup_view
|
||||
)
|
||||
|
||||
mod_name, func_name = get_mod_func(lookup_view)
|
||||
if not func_name: # No '.' in lookup_view
|
||||
if can_fail:
|
||||
|
||||
Reference in New Issue
Block a user