diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
old mode 100644
new mode 100755
index 3a5c12b..03deab2
a
|
b
|
from django.utils.text import capfirst
|
14 | 14 | from django.utils.translation import ugettext as _ |
15 | 15 | from django.views.decorators.cache import never_cache |
16 | 16 | from django.conf import settings |
| 17 | from django.http import HttpResponseRedirect |
17 | 18 | |
18 | 19 | LOGIN_FORM_KEY = 'this_is_the_login_form' |
19 | 20 | |
… |
… |
class AdminSite(object):
|
188 | 189 | """ |
189 | 190 | def inner(request, *args, **kwargs): |
190 | 191 | if not self.has_permission(request): |
191 | | return self.login(request) |
| 192 | extra_context = {} |
| 193 | if request.path.endswith(reverse('admin:logout')): |
| 194 | extra_context[REDIRECT_FIELD_NAME] = reverse('admin:index') |
| 195 | return self.login(request, extra_context) |
192 | 196 | return view(request, *args, **kwargs) |
193 | 197 | if not cacheable: |
194 | 198 | inner = never_cache(inner) |
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
old mode 100644
new mode 100755
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
old mode 100644
new mode 100755
index b6e7b9e..95d935d
a
|
b
|
class AdminCustomSaveRelatedTests(TestCase):
|
3255 | 3255 | |
3256 | 3256 | self.assertEqual('Josh Stone', Parent.objects.latest('id').name) |
3257 | 3257 | self.assertEqual([u'Catherine Stone', u'Paul Stone'], children_names) |
| 3258 | |
| 3259 | |
| 3260 | class AdminViewLogoutTest(TestCase): |
| 3261 | urls = "regressiontests.admin_views.urls" |
| 3262 | fixtures = ['admin-views-users.xml', ] |
| 3263 | |
| 3264 | def setUp(self): |
| 3265 | self.client.login(username='super', password='secret') |
| 3266 | |
| 3267 | def tearDown(self): |
| 3268 | self.client.logout() |
| 3269 | |
| 3270 | def test_client_logout_url_can_be_used_to_login(self): |
| 3271 | response = self.client.get('/test_admin/admin/logout/') |
| 3272 | self.assertEqual(response.status_code, 200) |
| 3273 | self.assertEqual(response.template_name, 'registration/logged_out.html') |
| 3274 | self.assertEqual(response.request['PATH_INFO'], '/test_admin/admin/logout/') |
| 3275 | |
| 3276 | # we are now logged out - issue a GET request to `/test_admin/admin/logout/` |
| 3277 | response = self.client.get('/test_admin/admin/logout/') |
| 3278 | self.assertTrue( |
| 3279 | '<input type="hidden" name="next" value="/test_admin/admin/" />' in response.content) |