Skip to content

Commit

Permalink
Fixed #2875: made urlresolvers.get_mod_func() deal with non-qualified…
Browse files Browse the repository at this point in the history
… callbacks better. Thanks, Matt McClanahan.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Nov 7, 2006
1 parent a1199d8 commit afb2366
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/core/urlresolvers.py
Expand Up @@ -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):
Expand Down

0 comments on commit afb2366

Please sign in to comment.