diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-09 17:35:19 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-09 17:35:19 +0000 |
| commit | 4747347385fa5c3a1e948a892fd5e60fb8f53bed (patch) | |
| tree | 6614fa7bed50e73f629c0f2036431bfed85b9162 /django/contrib/admin/views | |
| parent | 400a6b23cf07b83b97f515cf23ee9ab5853f38bc (diff) | |
Fixed #5801: admin requests with GET args now get properly bounced through login with those args intact. Thanks for the patch, Rozza.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin/views')
| -rw-r--r-- | django/contrib/admin/views/decorators.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/views/decorators.py b/django/contrib/admin/views/decorators.py index cf0cd704c2..4b36e3ffa2 100644 --- a/django/contrib/admin/views/decorators.py +++ b/django/contrib/admin/views/decorators.py @@ -28,7 +28,7 @@ def _display_login_form(request, error_message=''): post_data = _encode_post_data({}) return render_to_response('admin/login.html', { 'title': _('Log in'), - 'app_path': request.path, + 'app_path': request.get_full_path(), 'post_data': post_data, 'error_message': error_message }, context_instance=template.RequestContext(request)) @@ -84,7 +84,7 @@ def staff_member_required(view_func): if '@' in username: # Mistakenly entered e-mail address instead of username? Look it up. users = list(User.objects.filter(email=username)) - if len(users) == 1: + if len(users) == 1 and users[0].check_password(password): message = _("Your e-mail address is not your username. Try '%s' instead.") % users[0].username else: # Either we cannot find the user, or if more than 1 @@ -106,7 +106,7 @@ def staff_member_required(view_func): return view_func(request, *args, **kwargs) else: request.session.delete_test_cookie() - return http.HttpResponseRedirect(request.path) + return http.HttpResponseRedirect(request.get_full_path()) else: return _display_login_form(request, ERROR_MESSAGE) |
