1
0
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:
Harry
2015-04-24 20:51:26 +01:00
committed by Markus Holtermann
parent 86aaffa5a3
commit 40768ec29d
4 changed files with 12 additions and 4 deletions

View File

@@ -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: