Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed tabs in source, stupid emacs.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9817 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0326574d0ecf2eeded92d66855822dd2e602297f 1 parent 95ed07e
@spookylukey spookylukey authored
Showing with 12 additions and 12 deletions.
  1. +4 −4 django/contrib/csrf/middleware.py
  2. +8 −8 django/contrib/csrf/tests.py
View
8 django/contrib/csrf/middleware.py
@@ -65,8 +65,8 @@ class CsrfResponseMiddleware(object):
session.
"""
def process_response(self, request, response):
- if getattr(response, 'csrf_exempt', False):
- return response
+ if getattr(response, 'csrf_exempt', False):
+ return response
csrf_token = None
try:
@@ -133,8 +133,8 @@ def csrf_response_exempt(view_func):
"""
def wrapped_view(*args, **kwargs):
resp = view_func(*args, **kwargs)
- resp.csrf_exempt = True
- return resp
+ resp.csrf_exempt = True
+ return resp
return wraps(view_func)(wrapped_view)
def csrf_view_exempt(view_func):
View
16 django/contrib/csrf/tests.py
@@ -63,7 +63,7 @@ def test_process_response_no_session(self):
"""
req = self._get_GET_no_session_request()
resp = self._get_post_form_response()
- resp_content = resp.content # needed because process_response modifies resp
+ resp_content = resp.content # needed because process_response modifies resp
resp2 = CsrfMiddleware().process_response(req, resp)
self.assertEquals(resp_content, resp2.content)
@@ -73,7 +73,7 @@ def test_process_response_existing_session(self):
"""
req = self._get_GET_session_request()
resp = self._get_post_form_response()
- resp_content = resp.content # needed because process_response modifies resp
+ resp_content = resp.content # needed because process_response modifies resp
resp2 = CsrfMiddleware().process_response(req, resp)
self.assertNotEqual(resp_content, resp2.content)
self._check_token_present(resp2)
@@ -84,18 +84,18 @@ def test_process_response_new_session(self):
"""
req = self._get_GET_no_session_request() # no session in request
resp = self._get_new_session_response() # but new session started
- resp_content = resp.content # needed because process_response modifies resp
+ resp_content = resp.content # needed because process_response modifies resp
resp2 = CsrfMiddleware().process_response(req, resp)
self.assertNotEqual(resp_content, resp2.content)
self._check_token_present(resp2)
def test_process_response_exempt_view(self):
- """
- Check that no post processing is done for an exempt view
- """
+ """
+ Check that no post processing is done for an exempt view
+ """
req = self._get_POST_session_request()
- resp = csrf_exempt(self.get_view())(req)
- resp_content = resp.content
+ resp = csrf_exempt(self.get_view())(req)
+ resp_content = resp.content
resp2 = CsrfMiddleware().process_response(req, resp)
self.assertEquals(resp_content, resp2.content)
Please sign in to comment.
Something went wrong with that request. Please try again.