Ticket #2875: urlresolver-getmodfunc.diff

File urlresolver-getmodfunc.diff, 582 bytes (added by Matt McClanahan <cardinal@…>, 18 years ago)
  • django/core/urlresolvers.py

     
    2020def get_mod_func(callback):
    2121    # Converts 'django.views.news.stories.story_detail' to
    2222    # ['django.views.news.stories', 'story_detail']
    23     dot = callback.rindex('.')
     23    try:
     24        dot = callback.rindex('.')
     25    except ValueError:
     26        return callback, ''
    2427    return callback[:dot], callback[dot+1:]
    2528
    2629def reverse_helper(regex, *args, **kwargs):
Back to Top