Ticket #15115: admin_site_url_namespaces_20110119.diff

File admin_site_url_namespaces_20110119.diff, 1.4 KB (added by Christian Hammond, 14 years ago)

Fixes two cases of "admin:" being hard-coded.

  • django/contrib/admin/widgets.py

     
    223223        rel_to = self.rel.to
    224224        info = (rel_to._meta.app_label, rel_to._meta.object_name.lower())
    225225        try:
    226             related_url = reverse('admin:%s_%s_add' % info, current_app=self.admin_site.name)
     226            related_url = reverse('%s:%s_%s_add' % (self.admin_site.name, info),
     227                                  current_app=self.admin_site.name)
    227228        except NoReverseMatch:
    228229            info = (self.admin_site.root_path, rel_to._meta.app_label, rel_to._meta.object_name.lower())
    229230            related_url = '%s%s/%s/add/' % info
  • django/contrib/admin/sites.py

     
    251251        if self.root_path is not None:
    252252            url = '%spassword_change/done/' % self.root_path
    253253        else:
    254             url = reverse('admin:password_change_done', current_app=self.name)
     254            url = reverse('%s:password_change_done' % self.name, current_app=self.name)
    255255        defaults = {
    256256            'current_app': self.name,
    257257            'post_change_redirect': url
Back to Top