Skip to content

Commit 3408cc4

Browse files
committed
Merge the branch term-consistency
Also, make sure just rename the field and don't accidentally nuke the fibre field ;)
1 parent 352c19b commit 3408cc4

File tree

5 files changed

+12
-31
lines changed

5 files changed

+12
-31
lines changed

wger/nutrition/dataclasses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class IngredientData:
3131
carbohydrates_sugar: Optional[float]
3232
fat: float
3333
fat_saturated: Optional[float]
34-
fibres: Optional[float]
34+
fiber: Optional[float]
3535
sodium: Optional[float]
3636
code: Optional[str]
3737
source_name: str
@@ -58,7 +58,7 @@ def sanity_checks(self):
5858
'carbohydrates',
5959
'carbohydrates_sugar',
6060
'sodium',
61-
'fibres',
61+
'fiber',
6262
]
6363
for macro in macros:
6464
value = getattr(self, macro)

wger/nutrition/migrations/0022_fiber_spelling.py

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
# Generated by Django 4.2.6 on 2024-05-21 19:40
1+
# Generated by Django 4.2.6 on 2024-05-21 19:32
22

33
from django.db import migrations
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('nutrition', '0022_fiber_spelling'),
8+
('nutrition', '0022_add_remote_id_increase_author_field_length'),
109
]
1110

1211
operations = [
12+
migrations.RenameField(
13+
model_name='ingredient',
14+
old_name='fibers',
15+
new_name='fiber',
16+
),
1317
migrations.RenameField(
1418
model_name='nutritionplan',
1519
old_name='goal_fibers',

wger/nutrition/tests/test_usda.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_regular_response(self):
218218
carbohydrates_sugar=None,
219219
fat=3.24,
220220
fat_saturated=None,
221-
fibres=None,
221+
fiber=None,
222222
sodium=None,
223223
code=None,
224224
source_name='USDA',
@@ -228,7 +228,7 @@ def test_regular_response(self):
228228
status=AbstractSubmissionModel.STATUS_ACCEPTED,
229229
license_id=CC_0_LICENSE_ID,
230230
license_author='U.S. Department of Agriculture, Agricultural Research Service, '
231-
'Beltsville Human Nutrition Research Center. FoodData Central.',
231+
'Beltsville Human Nutrition Research Center. FoodData Central.',
232232
license_title='Foo With Chocolate',
233233
license_object_url='https://fdc.nal.usda.gov/fdc-app.html#/food-details/1234567/nutrients',
234234
)

wger/nutrition/usda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def extract_info_from_usda(product_data: dict, language: int) -> IngredientData:
111111
carbohydrates_sugar=carbs_sugars,
112112
fat=fats,
113113
fat_saturated=fats_saturated,
114-
fibres=fiber,
114+
fiber=fiber,
115115
sodium=sodium,
116116
source_name=source_name,
117117
source_url=source_url,

0 commit comments

Comments
 (0)