diff --git a/apps/food/forms.py b/apps/food/forms.py index 0b2532aa..7551a8c5 100644 --- a/apps/food/forms.py +++ b/apps/food/forms.py @@ -22,7 +22,6 @@ class AddIngredientForms(forms.ModelForm): super().__init__(*args, **kwargs) self.fields['ingredient'].queryset = self.fields['ingredient'].queryset.filter( polymorphic_ctype__model='transformedfood', - owner_id=self.instance.owner_id, is_ready=False, is_active=True, was_eaten=False, @@ -70,7 +69,11 @@ class QRCodeForms(forms.ModelForm): """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.fields['food_container'].queryset = self.fields['food_container'].queryset.filter(is_ready=False) + self.fields['food_container'].queryset = self.fields['food_container'].queryset.filter( + is_active=True, + was_eaten=False, + polymorphic_ctype__model='transformedfood', + ) class Meta: model = QRCode