From edc670e87d79694798975fd360866f031eb3ef7b Mon Sep 17 00:00:00 2001 From: smilerz Date: Wed, 15 Dec 2021 16:59:33 -0600 Subject: [PATCH] filter fields available to inherit in space settings --- cookbook/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cookbook/forms.py b/cookbook/forms.py index f74b3cc6e..d5a4b1a0d 100644 --- a/cookbook/forms.py +++ b/cookbook/forms.py @@ -522,6 +522,10 @@ class SpacePreferenceForm(forms.ModelForm): reset_food_inherit = forms.BooleanField(label=_("Reset Food Inheritance"), initial=False, required=False, help_text=_("Reset all food to inherit the fields configured.")) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # populates the post + self.fields['food_inherit'].queryset = Food.inherit_fields + class Meta: model = Space