Skip to content

Commit

Permalink
Fixed regression in choices setter for Django 4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
carltongibson committed Mar 27, 2024
1 parent 84b3280 commit 66e1452
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django_filters/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ def choices(self):
def choices(self, value):
if DJANGO_50:
value = self.iterator(self, value)
# Simple `super()` syntax for calling a parent property setter is
# unsupported. See https://github.com/python/cpython/issues/59170
super(ChoiceIteratorMixin, self.__class__).choices.__set__(self, value)
else:
super()._set_choices(value)
value = self.iterator(self, self._choices)

# Simple `super()` syntax for calling a parent property setter is
# unsupported. See https://github.com/python/cpython/issues/59170
super(ChoiceIteratorMixin, self.__class__).choices.__set__(self, value)
self._choices = self.widget.choices = value


# Unlike their Model* counterparts, forms.ChoiceField and forms.MultipleChoiceField do not set empty_label
Expand Down

0 comments on commit 66e1452

Please sign in to comment.