1. Luke Plant
  2. django


adr...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed a2a6273

Added leading slash to output of core.urlresolvers.reverse(), and made 'urlconf' a keyword argument

  • Participants
  • Parent commits 7390b2b
  • Branches default

Comments (0)

Files changed (1)

File django/core/urlresolvers.py

View file
  • Ignore whitespace
     resolver = RegexURLResolver(r'^/', urlconf)
     return resolver.resolve(path)
-def reverse(viewname, urlconf, args=None, kwargs=None):
+def reverse(viewname, urlconf=None, args=None, kwargs=None):
     args = args or []
     kwargs = kwargs or {}
     if urlconf is None:
         from django.conf import settings
         urlconf = settings.ROOT_URLCONF
     resolver = RegexURLResolver(r'^/', urlconf)
-    return resolver.reverse(viewname, *args, **kwargs)
+    return '/' + resolver.reverse(viewname, *args, **kwargs)