Ticket #7821: urlresolvers-reverse.diff

File urlresolvers-reverse.diff, 658 bytes (added by jmohr@…, 7 years ago)

Add a value to the NoReverseMatch exception raised by django.core.urlresolvers.reverse

  • django/core/urlresolvers.py

     
    281281            raise NoReverseMatch
    282282        if lookup_view in self.reverse_dict:
    283283            return u''.join([reverse_helper(part.regex, *args, **kwargs) for part in self.reverse_dict[lookup_view]])
    284         raise NoReverseMatch
     284        raise NoReverseMatch('Unable to find reverse match for "%s"' % lookup_view)
    285285
    286286    def reverse_helper(self, lookup_view, *args, **kwargs):
    287287        sub_match = self.reverse(lookup_view, *args, **kwargs)
Back to Top