Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
colin99d committed Aug 21, 2023
1 parent cae4853 commit 68c1874
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slowapi/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def is_exempt(self, request: Optional[Request] = None) -> bool:
"""
if self.exempt_when is None:
return False
if self._exempt_when_takes_request and request:
params = inspect.signature(self.exempt_when).parameters
param_len = len(params)
if param_len == 1 and request:
return self.exempt_when(request)
return self.exempt_when()

Expand Down

0 comments on commit 68c1874

Please sign in to comment.