From 4a1ec5adf723bbee26f5c352cfa172e8abebf277 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 30 Aug 2023 09:05:24 +0200 Subject: [PATCH] fixed icon issues --- cookbook/helper/property_helper.py | 2 +- cookbook/models.py | 2 +- cookbook/tests/factories/__init__.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cookbook/helper/property_helper.py b/cookbook/helper/property_helper.py index bff69aaa..ed19990c 100644 --- a/cookbook/helper/property_helper.py +++ b/cookbook/helper/property_helper.py @@ -34,7 +34,7 @@ class FoodPropertyHelper: caches['default'].set(CacheHelper(self.space).PROPERTY_TYPE_CACHE_KEY, property_types, 60 * 60) # cache is cleared on property type save signal so long duration is fine for fpt in property_types: - computed_properties[fpt.id] = {'id': fpt.id, 'name': fpt.name, 'icon': fpt.icon, 'description': fpt.description, 'unit': fpt.unit, 'order': fpt.order, 'food_values': {}, 'total_value': 0, 'missing_value': False} + computed_properties[fpt.id] = {'id': fpt.id, 'name': fpt.name, 'description': fpt.description, 'unit': fpt.unit, 'order': fpt.order, 'food_values': {}, 'total_value': 0, 'missing_value': False} uch = UnitConversionHelper(self.space) diff --git a/cookbook/models.py b/cookbook/models.py index 86d30885..5651aa7b 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -766,7 +766,7 @@ class PropertyType(models.Model, PermissionModelMixin): order = models.IntegerField(default=0) description = models.CharField(max_length=512, blank=True, null=True) category = models.CharField(max_length=64, choices=((NUTRITION, _('Nutrition')), (ALLERGEN, _('Allergen')), - (PRICE, _('Price')), (GOAL, _('Goal')), (OTHER, _('Other'))), null=True, blank=True) + (PRICE, _('Price')), (GOAL, _('Goal')), (OTHER, _('Other'))), null=True, blank=True) open_data_slug = models.CharField(max_length=128, null=True, blank=True, default=None) # TODO show if empty property? diff --git a/cookbook/tests/factories/__init__.py b/cookbook/tests/factories/__init__.py index 0b2ff58f..d6c288c8 100644 --- a/cookbook/tests/factories/__init__.py +++ b/cookbook/tests/factories/__init__.py @@ -143,7 +143,6 @@ class RecipeBookFactory(factory.django.DjangoModelFactory): name = factory.LazyAttribute(lambda x: faker.sentence( nb_words=3, variable_nb_words=False)) description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)) - icon = None # shared = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space')) created_by = factory.SubFactory( UserFactory, space=factory.SelfAttribute('..space'))