Skip to content

Commit d498e23

Browse files
authored
Merge pull request #4766 from OWASP-BLT/copilot/fix-throttling-issue
2 parents 8454396 + 57b7074 commit d498e23

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

blt/middleware/throttling.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import sys
32

43
from django.conf import settings
54
from django.core.cache import cache
@@ -49,7 +48,7 @@ def __call__(self, request):
4948
def should_skip_throttle(self, request):
5049
"""Check if request should be exempt from throttling."""
5150
# Skip throttling during tests
52-
if "test" in sys.argv:
51+
if getattr(settings, "IS_TEST", False) or getattr(settings, "TESTING", False):
5352
logger.debug("Skipping throttling for test mode")
5453
return True
5554
if any(request.path.startswith(p) for p in self.EXEMPT_PATHS):

0 commit comments

Comments
 (0)