summaryrefslogtreecommitdiff
path: root/django/views/decorators/csrf.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2022-05-22 08:26:21 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-25 10:58:48 +0200
commit8cf4de206ce4e1fe1e06a55a30c4e6bebe7cf10a (patch)
treef9abbdabd7e7da2f237092458b51d4407607e86c /django/views/decorators/csrf.py
parentaff649a3bd0c4fd8f7d859464f0eb907e877443f (diff)
Normalized decorator style for functools.wraps.
Diffstat (limited to 'django/views/decorators/csrf.py')
-rw-r--r--django/views/decorators/csrf.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/views/decorators/csrf.py b/django/views/decorators/csrf.py
index e6c9cb7660..40ac58bc1d 100644
--- a/django/views/decorators/csrf.py
+++ b/django/views/decorators/csrf.py
@@ -50,8 +50,9 @@ def csrf_exempt(view_func):
"""Mark a view function as being exempt from the CSRF view protection."""
# view_func.csrf_exempt = True would also work, but decorators are nicer
# if they don't have side effects, so return a new function.
+ @wraps(view_func)
def wrapper_view(*args, **kwargs):
return view_func(*args, **kwargs)
wrapper_view.csrf_exempt = True
- return wraps(view_func)(wrapper_view)
+ return wrapper_view