mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 09:12:11 +01:00 
			
		
		
		
	Fix problem in addingredientform, change filter for container in QrcodeForm
This commit is contained in:
		@@ -22,7 +22,6 @@ class AddIngredientForms(forms.ModelForm):
 | 
				
			|||||||
        super().__init__(*args, **kwargs)
 | 
					        super().__init__(*args, **kwargs)
 | 
				
			||||||
        self.fields['ingredient'].queryset = self.fields['ingredient'].queryset.filter(
 | 
					        self.fields['ingredient'].queryset = self.fields['ingredient'].queryset.filter(
 | 
				
			||||||
            polymorphic_ctype__model='transformedfood',
 | 
					            polymorphic_ctype__model='transformedfood',
 | 
				
			||||||
            owner_id=self.instance.owner_id,
 | 
					 | 
				
			||||||
            is_ready=False,
 | 
					            is_ready=False,
 | 
				
			||||||
            is_active=True,
 | 
					            is_active=True,
 | 
				
			||||||
            was_eaten=False,
 | 
					            was_eaten=False,
 | 
				
			||||||
@@ -70,7 +69,11 @@ class QRCodeForms(forms.ModelForm):
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
    def __init__(self, *args, **kwargs):
 | 
					    def __init__(self, *args, **kwargs):
 | 
				
			||||||
        super().__init__(*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:
 | 
					    class Meta:
 | 
				
			||||||
        model = QRCode
 | 
					        model = QRCode
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user