Skip to content

Commit bf7c5d3

Browse files
committed
decorate views
1 parent c2f3e94 commit bf7c5d3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

debug_toolbar/_compat.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
try:
22
from django.contrib.auth.decorators import login_not_required
33
except ImportError:
4-
5-
def login_not_required(func):
6-
return func
4+
# For Django < 5.1, copy the current Django implementation
5+
def login_not_required(view_func):
6+
"""
7+
Decorator for views that allows access to unauthenticated requests.
8+
"""
9+
view_func.login_required = False
10+
return view_func

0 commit comments

Comments
 (0)