filter fields available to inherit in space settings

This commit is contained in:
smilerz
2021-12-15 16:59:33 -06:00
parent a313039b65
commit edc670e87d

View File

@@ -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