From fd5d923c6bb3c22eb265dd45466dedea7d85d0dc Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 4 Aug 2006 04:18:12 +0000 Subject: [PATCH] Fixed #61 -- No more editing hashes when creating users via the admin. Created a special-case 'Add user' admin view. The change form still displays the hash, for the moment. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3520 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../templates/admin/auth/user/add_form.html | 28 +++++++++++++ django/contrib/admin/urls.py | 3 ++ django/contrib/admin/views/auth.py | 39 +++++++++++++++++++ django/contrib/auth/forms.py | 22 +++++++++++ 4 files changed, 92 insertions(+) create mode 100644 django/contrib/admin/templates/admin/auth/user/add_form.html create mode 100644 django/contrib/admin/views/auth.py diff --git a/django/contrib/admin/templates/admin/auth/user/add_form.html b/django/contrib/admin/templates/admin/auth/user/add_form.html new file mode 100644 index 0000000000..139fa6a75e --- /dev/null +++ b/django/contrib/admin/templates/admin/auth/user/add_form.html @@ -0,0 +1,28 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} + +{% block after_field_sets %} + +

{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}

+ +
+ +
+ {{ form.username.html_error_list }} + {{ form.username }} +

{{ username_help_text }}

+
+ +
+ {{ form.password1.html_error_list }} + {{ form.password1 }} +
+ +
+ {{ form.password2.html_error_list }} + {{ form.password2 }} +

{% trans 'Enter the same password as above, for verification.' %}

+
+ +
+{% endblock %} diff --git a/django/contrib/admin/urls.py b/django/contrib/admin/urls.py index bd894d8de1..88cf8306a3 100644 --- a/django/contrib/admin/urls.py +++ b/django/contrib/admin/urls.py @@ -28,6 +28,9 @@ urlpatterns = patterns('', # ('^doc/templates/$', 'django.views.admin.doc.template_index'), ('^doc/templates/(?P