Ticket #5251: show_in_web-6000.diff

File show_in_web-6000.diff, 1.5 KB (added by Florian Apolloner, 17 years ago)
  • django/contrib/admin/urls.py

     
    22
    33urlpatterns = patterns('',
    44    #('^$', 'django.contrib.admin.views.main.index'),
    5     ('^r/(\d+)/(.*)/$', 'django.views.defaults.shortcut'),
     5    #('^r/(\d+)/(\d+)/$', 'django.views.defaults.shortcut'),
    66    #('^jsi18n/$', i18n_view, {'packages': 'django.conf'}),
    77    #('^logout/$', 'django.contrib.auth.views.logout'),
    88    #('^password_change/$', 'django.contrib.auth.views.password_change'),
  • django/contrib/admin/sites.py

     
    1515LOGIN_FORM_KEY = 'this_is_the_login_form'
    1616
    1717USER_CHANGE_PASSWORD_URL_RE = re.compile('auth/user/(\d+)/password')
     18RESOLVE_ABSOLUTE_URL_RE = re.compile('r/(\d+)/(\d+)')
    1819
    1920class AlreadyRegistered(Exception):
    2021    pass
     
    127128            match = USER_CHANGE_PASSWORD_URL_RE.match(url)
    128129            if match:
    129130                return self.user_change_password(request, match.group(1))
    130                
     131            match = RESOLVE_ABSOLUTE_URL_RE.match(url)
     132            if match:
     133                from django.views.defaults import shortcut
     134                return shortcut(request, *match.groups() )
     135
    131136            if '/' in url:
    132137                return self.model_page(request, *url.split('/', 2))
    133138
Back to Top