Skip to content

Commit

Permalink
Revert "Refs #31262 -- Delegated RelatedFieldWidgetWrapper._choices h…
Browse files Browse the repository at this point in the history
…andling to wrapped widget."

This reverts commit 54f4eb603d148263ea66856174b6530d11937da5.
  • Loading branch information
ngnpope committed Jul 21, 2023
1 parent 9b70683 commit 9cc003f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions django/contrib/admin/widgets.py
Expand Up @@ -302,14 +302,6 @@ def choices(self):
def choices(self, value):
self.widget.choices = value

@property
def _choices(self):
return self.widget._choices

@_choices.setter
def _choices(self, value):
self.widget._choices = value

def get_related_url(self, info, action, *args):
return reverse(
"admin:%s_%s_%s" % (info + (action,)),
Expand Down
4 changes: 2 additions & 2 deletions django/forms/fields.py
Expand Up @@ -885,8 +885,8 @@ def choices(self):
@choices.setter
def choices(self, value):
# Setting choices on the field also sets the choices on the widget.
# Note that we bypass the property setter to avoid re-normalizing.
self._choices = self.widget._choices = normalize_field_choices(value)
# Note that the property setter for the widget will re-normalize.
self._choices = self.widget.choices = normalize_field_choices(value)

def to_python(self, value):
"""Return a string."""
Expand Down

0 comments on commit 9cc003f

Please sign in to comment.