Skip to content

Commit

Permalink
Fix compatibility with python<=3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
fle committed Nov 8, 2023
1 parent c4171b0 commit 63a93ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_filters/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def __init__(self, choices=None, filters=None, *args, **kwargs):
all_choices = list(
chain.from_iterable(
[subchoice[0] for subchoice in choice[1]]
if isinstance(choice[1], list | tuple) # This is an optgroup
if isinstance(choice[1], (list, tuple)) # This is an optgroup
else [choice[0]]
for choice in self.choices
)
Expand Down

0 comments on commit 63a93ff

Please sign in to comment.