From 8cf4de206ce4e1fe1e06a55a30c4e6bebe7cf10a Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 22 May 2022 08:26:21 +0200 Subject: Normalized decorator style for functools.wraps. --- django/views/decorators/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/views/decorators/common.py') diff --git a/django/views/decorators/common.py b/django/views/decorators/common.py index a973389549..fe4d58f591 100644 --- a/django/views/decorators/common.py +++ b/django/views/decorators/common.py @@ -8,8 +8,9 @@ def no_append_slash(view_func): """ # view_func.should_append_slash = False 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.should_append_slash = False - return wraps(view_func)(wrapper_view) + return wrapper_view -- cgit v1.3