--- /Users/riccardo/Desktop/sites.py	2012-09-21 16:28:47.000000000 +0200
+++ /Dropbox/Development/stable/python/django/contrib/admin/sites.py	2012-09-21 16:28:02.000000000 +0200
@@ -10,7 +10,6 @@
 from django.core.urlresolvers import reverse, NoReverseMatch
 from django.template.response import TemplateResponse
 from django.utils.safestring import mark_safe
-from django.utils import six
 from django.utils.text import capfirst
 from django.utils.translation import ugettext as _
 from django.views.decorators.cache import never_cache
@@ -134,7 +133,7 @@
         """
         Get all the enabled actions as an iterable of (name, func).
         """
-        return six.iteritems(self._actions)
+        return self._actions.iteritems()
 
     def has_permission(self, request):
         """
@@ -189,9 +188,9 @@
         """
         def inner(request, *args, **kwargs):
             if not self.has_permission(request):
-                if request.path == reverse('admin:logout',
+                if request.path == reverse('%s:logout' % self.name,
                                            current_app=self.name):
-                    index_path = reverse('admin:index', current_app=self.name)
+                    index_path = reverse('%s:index' % self.name, current_app=self.name)
                     return HttpResponseRedirect(index_path)
                 return self.login(request)
             return view(request, *args, **kwargs)
@@ -232,15 +231,14 @@
                 wrap(self.i18n_javascript, cacheable=True),
                 name='jsi18n'),
             url(r'^r/(?P<content_type_id>\d+)/(?P<object_id>.+)/$',
-                wrap(contenttype_views.shortcut),
-                name='view_on_site'),
+                wrap(contenttype_views.shortcut)),
             url(r'^(?P<app_label>\w+)/$',
                 wrap(self.app_index),
                 name='app_list')
         )
 
         # Add in each model's views.
-        for model, model_admin in six.iteritems(self._registry):
+        for model, model_admin in self._registry.iteritems():
             urlpatterns += patterns('',
                 url(r'^%s/%s/' % (model._meta.app_label, model._meta.module_name),
                     include(model_admin.urls))
@@ -251,14 +249,14 @@
     def urls(self):
         return self.get_urls(), self.app_name, self.name
 
-    def password_change(self, request):
+    def password_change(self, request, extra_context = None):
         """
         Handles the "change password" task -- both form display and validation.
         """
         from django.contrib.auth.views import password_change
-        url = reverse('admin:password_change_done', current_app=self.name)
+        url = reverse('%s:password_change_done' % self.name, current_app=self.name)
         defaults = {
-            'current_app': self.name,
+            'current_app': self.name, 'extra_context': extra_context or {},
             'post_change_redirect': url
         }
         if self.password_change_template is not None:
@@ -345,19 +343,19 @@
                 # Check whether user has any perm for this module.
                 # If so, add the module to the model_list.
                 if True in perms.values():
-                    info = (app_label, model._meta.module_name)
+                    info = (self.name, app_label, model._meta.module_name)
                     model_dict = {
                         'name': capfirst(model._meta.verbose_name_plural),
                         'perms': perms,
                     }
                     if perms.get('change', False):
                         try:
-                            model_dict['admin_url'] = reverse('admin:%s_%s_changelist' % info, current_app=self.name)
+                            model_dict['admin_url'] = reverse('%s:%s_%s_changelist' % info, current_app=self.name)
                         except NoReverseMatch:
                             pass
                     if perms.get('add', False):
                         try:
-                            model_dict['add_url'] = reverse('admin:%s_%s_add' % info, current_app=self.name)
+                            model_dict['add_url'] = reverse('%s:%s_%s_add' % info, current_app=self.name)
                         except NoReverseMatch:
                             pass
                     if app_label in app_dict:
@@ -365,13 +363,13 @@
                     else:
                         app_dict[app_label] = {
                             'name': app_label.title(),
-                            'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
+                            'app_url': reverse('%s:app_list' % self.name, kwargs={'app_label': app_label}, current_app=self.name),
                             'has_module_perms': has_module_perms,
                             'models': [model_dict],
                         }
 
         # Sort the apps alphabetically.
-        app_list = list(six.itervalues(app_dict))
+        app_list = app_dict.values()
         app_list.sort(key=lambda x: x['name'])
 
         # Sort the models alphabetically within each app.
@@ -399,19 +397,19 @@
                     # Check whether user has any perm for this module.
                     # If so, add the module to the model_list.
                     if True in perms.values():
-                        info = (app_label, model._meta.module_name)
+                        info = (self.name, app_label, model._meta.module_name)
                         model_dict = {
                             'name': capfirst(model._meta.verbose_name_plural),
                             'perms': perms,
                         }
                         if perms.get('change', False):
                             try:
-                                model_dict['admin_url'] = reverse('admin:%s_%s_changelist' % info, current_app=self.name)
+                                model_dict['admin_url'] = reverse('%s:%s_%s_changelist' % info, current_app=self.name)
                             except NoReverseMatch:
                                 pass
                         if perms.get('add', False):
                             try:
-                                model_dict['add_url'] = reverse('admin:%s_%s_add' % info, current_app=self.name)
+                                model_dict['add_url'] = reverse('%s:%s_%s_add' % info, current_app=self.name)
                             except NoReverseMatch:
                                 pass
                         if app_dict:
