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)