Fixed #2875: made urlresolvers.get_mod_func() deal with non-qualified callbacks better. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a1199d8528
commit
afb2366430
|
@ -21,7 +21,10 @@ class NoReverseMatch(Exception):
|
|||
def get_mod_func(callback):
|
||||
# Converts 'django.views.news.stories.story_detail' to
|
||||
# ['django.views.news.stories', 'story_detail']
|
||||
dot = callback.rindex('.')
|
||||
try:
|
||||
dot = callback.rindex('.')
|
||||
except ValueError:
|
||||
return callback, ''
|
||||
return callback[:dot], callback[dot+1:]
|
||||
|
||||
def reverse_helper(regex, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue