diff options
Diffstat (limited to 'django/contrib/admin')
-rw-r--r-- | django/contrib/admin/options.py | 2 | ||||
-rw-r--r-- | django/contrib/admin/sites.py | 6 | ||||
-rw-r--r-- | django/contrib/admin/templates/admin/auth/user/add_form.html | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 1f8ff6dbd1..d44a5121f8 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -501,7 +501,7 @@ class ModelAdmin(BaseModelAdmin): # Convert the actions into a SortedDict keyed by name # and sorted by description. - actions.sort(lambda a,b: cmp(a[2].lower(), b[2].lower())) + actions.sort(key=lambda k: k[2].lower()) actions = SortedDict([ (name, (func, name, desc)) for func, name, desc in actions diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index 4446490451..d0d6473a34 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -379,11 +379,11 @@ class AdminSite(object): # Sort the apps alphabetically. app_list = app_dict.values() - app_list.sort(lambda x, y: cmp(x['name'], y['name'])) + app_list.sort(key=lambda x: x['name']) # Sort the models alphabetically within each app. for app in app_list: - app['models'].sort(lambda x, y: cmp(x['name'], y['name'])) + app['models'].sort(key=lambda x: x['name']) context = { 'title': _('Site administration'), @@ -443,7 +443,7 @@ class AdminSite(object): if not app_dict: raise http.Http404('The requested admin page does not exist.') # Sort the models alphabetically within each app. - app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) + app_dict['models'].sort(key=lambda x: x['name']) context = { 'title': _('%s administration') % capfirst(app_label), 'app_list': [app_dict], diff --git a/django/contrib/admin/templates/admin/auth/user/add_form.html b/django/contrib/admin/templates/admin/auth/user/add_form.html index b57f59b82e..c8889eb069 100644 --- a/django/contrib/admin/templates/admin/auth/user/add_form.html +++ b/django/contrib/admin/templates/admin/auth/user/add_form.html @@ -2,8 +2,11 @@ {% load i18n %} {% block form_top %} + {% if not is_popup %} <p>{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}</p> - <input type="hidden" name="_continue" value="1" /> + {% else %} + <p>{% trans "Enter a username and password." %}</p> + {% endif %} {% endblock %} {% block after_field_sets %} |