diff --git a/django/views/decorators/http.py b/django/views/decorators/http.py
index 495a7b1..c282da5 100644
a
|
b
|
def condition(etag_func=None, last_modified_func=None):
|
153 | 153 | |
154 | 154 | return response |
155 | 155 | |
156 | | return inner |
| 156 | return wraps(func, assigned=available_attrs(func))(inner) |
157 | 157 | return decorator |
158 | 158 | |
159 | 159 | # Shortcut decorators for common cases based on ETag or Last-Modified only |
diff --git a/tests/regressiontests/decorators/tests.py b/tests/regressiontests/decorators/tests.py
index 51f75d7..749df43 100644
a
|
b
|
from django.utils.functional import allow_lazy, lazy, memoize
|
11 | 11 | from django.utils.unittest import TestCase |
12 | 12 | from django.views.decorators.cache import cache_page, never_cache, cache_control |
13 | 13 | from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt |
14 | | from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe |
| 14 | from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition |
15 | 15 | from django.views.decorators.vary import vary_on_headers, vary_on_cookie |
16 | 16 | |
17 | 17 | |
… |
… |
full_decorator = compose(
|
38 | 38 | require_GET, |
39 | 39 | require_POST, |
40 | 40 | require_safe, |
| 41 | condition(lambda r: None, lambda r: None), |
41 | 42 | |
42 | 43 | # django.views.decorators.vary |
43 | 44 | vary_on_headers('Accept-language'), |