diff --git a/django/contrib/auth/admin.py b/django/contrib/auth/admin.py
index f97935d..41458e4 100644
a
|
b
|
class UserAdmin(admin.ModelAdmin):
|
28 | 28 | def add_view(self, request): |
29 | 29 | # avoid a circular import. see #6718. |
30 | 30 | from django.contrib.auth.forms import UserCreationForm |
31 | | if not self.has_change_permission(request): |
| 31 | if not self.has_add_permission(request): |
32 | 32 | raise PermissionDenied |
| 33 | |
33 | 34 | if request.method == 'POST': |
34 | 35 | form = UserCreationForm(request.POST) |
35 | 36 | if form.is_valid(): |
… |
… |
class UserAdmin(admin.ModelAdmin):
|
40 | 41 | return HttpResponseRedirect(request.path) |
41 | 42 | else: |
42 | 43 | request.user.message_set.create(message=msg + ' ' + ugettext("You may edit it again below.")) |
43 | | return HttpResponseRedirect('../%s/' % new_user.id) |
| 44 | |
| 45 | if self.has_change_permission(request, None): |
| 46 | # redirect to change view |
| 47 | post_url = '../%s/' % new_user.id |
| 48 | else: |
| 49 | # Object list will give 'Permission Denied', so go back to admin home |
| 50 | post_url = '../../../' |
| 51 | |
| 52 | return HttpResponseRedirect(post_url) |
44 | 53 | else: |
45 | 54 | form = UserCreationForm() |
46 | 55 | return render_to_response('admin/auth/user/add_form.html', { |