Skip to content

Commit a01d894

Browse files
committed
fix 'multiples' detection, cant do instance checks w/ subscripted generics (as is )
1 parent 0bda3a8 commit a01d894

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/server/_limiter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from ._exceptions import ValidationFailedException
1010
from ._params import extract_dates, extract_integers, extract_strings
1111
from ._security import _is_public_route, current_user, require_api_key, show_no_api_key_warning, resolve_auth_token, ERROR_MSG_RATE_LIMIT, ERROR_MSG_MULTIPLES
12-
from .utils import TimeValues
1312

1413

1514
def deduct_on_success(response: Response) -> bool:
@@ -59,8 +58,8 @@ def get_multiples_count(request):
5958
vals = multiples.get(k)(k)
6059
if len(vals) >= 2:
6160
multiple_selection_allowed -= 1
62-
elif len(vals) and isinstance(vals, TimeValues) and isinstance(vals[0], tuple):
63-
# else we have one TimeValue which is a tuple, representing a range, and thus is a "multiple"
61+
elif len(vals) and isinstance(vals, Sequence) and isinstance(vals[0], tuple):
62+
# else we have one val which is a tuple, representing a range, and thus is a "multiple"
6463
multiple_selection_allowed -= 1
6564
except ValidationFailedException:
6665
continue

0 commit comments

Comments
 (0)