From f29f77a1d5211e40f70397d9412422ef149583e1 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 14 Mar 2023 22:50:33 +0100 Subject: [PATCH] fixed ingredient to string plural --- cookbook/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/models.py b/cookbook/models.py index fa5b146d..1732750b 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -681,7 +681,7 @@ class Ingredient(ExportModelOperationsMixin('ingredient'), models.Model, Permiss if self.always_use_plural_unit and self.unit.plural_name not in (None, "") and not self.no_amount: unit = self.unit.plural_name else: - if self.amount > 1 and self.unit.plural_name not in (None, "") and not self.no_amount: + if self.amount > 1 and self.unit is not None and self.unit.plural_name not in (None, "") and not self.no_amount: unit = self.unit.plural_name else: unit = str(self.unit)