              cookie_is_new = True
  
          if request.method == 'POST':
              if getattr(request, '_dont_enforce_csrf_checks', False):
                  # Mechanism to turn off CSRF checks for test suite.  It comes after
                  # the creation of CSRF cookies, so that everything else continues to
 
</s> remove         if getattr(callback, 'csrf_exempt', False):
            return None

 </s> add  </s> remove from django.views.decorators.csrf import csrf_exempt
 </s> add from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt
        # Wait until request.META["CSRF_COOKIE"] has been manipulated before
        # bailing out, so that get_token still works
        if getattr(callback, 'csrf_exempt', False):
            return None

              cookie_is_new = True
  
        # Wait until request.META["CSRF_COOKIE"] has been manipulated before
        # bailing out, so that get_token still works
        if getattr(callback, 'csrf_exempt', False):
            return None

          if request.method == 'POST':
              if getattr(request, '_dont_enforce_csrf_checks', False):
                  # Mechanism to turn off CSRF checks for test suite.  It comes after
                  # the creation of CSRF cookies, so that everything else continues to
keep add keep keep keep keep
 Fixed #13716 - the CSRF get_token function stopped working for views with csrf_view_exempt

This was a regression caused by the the CSRF changes in 1.2.

Thanks to edevil for the report.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13336 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/middleware/csrf.py