Re. http://code.djangoproject.com/ticket/15354
diff --git a/django/views/decorators/csrf.py b/django/views/decorators/csrf.py
index c9fd82c..6e28808 100644
a
|
b
|
def csrf_exempt(view_func):
|
57 | 57 | return view_func(*args, **kwargs) |
58 | 58 | wrapped_view.csrf_exempt = True |
59 | 59 | return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view) |
| 60 | |
| 61 | def csrf_ensure_cookie(view_func): |
| 62 | """ |
| 63 | Ensures that the CSRF cookie is sent to the client, regardless of whether |
| 64 | we use it to generate a response. |
| 65 | """ |
| 66 | def wrapped_view(request, *args, **kwargs): |
| 67 | request.META["CSRF_COOKIE_USED"] = True |
| 68 | return view_func(request, *args, **kwargs) |
| 69 | return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view) |