From ce3d75834337f828937ba998fcb15a12f9b17f0a Mon Sep 17 00:00:00 2001 From: Ivan Nikolskiy Date: Tue, 10 Jun 2025 16:21:31 +0200 Subject: [PATCH] Some additions --- django_hoptcha/decorators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django_hoptcha/decorators.py b/django_hoptcha/decorators.py index 9c4b607..27dec26 100755 --- a/django_hoptcha/decorators.py +++ b/django_hoptcha/decorators.py @@ -81,9 +81,6 @@ def hoptcha_protected( - debug_ignore: do not bypass CAPTCHA if in debug mode. """ - if DEBUG and not debug_ignore: - return view_func(request, *args, **kwargs) - if isinstance(key, str): key_func = BUILTIN_KEYS.get(key) @@ -101,6 +98,9 @@ def hoptcha_protected( def decorator(view_func): @wraps(view_func) def _wrapped_view(request, *args, **kwargs): + if DEBUG and not debug_ignore: + return view_func(request, *args, **kwargs) + if exempt_if and exempt_if(request): return view_func(request, *args, **kwargs)