From a1160c310cfed9ab819e35e84f00f85dd073dd5a Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 16 Feb 2020 23:54:45 +0100 Subject: [PATCH] fixed fix of migration --- cookbook/migrations/0010_auto_20200130_1059.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/migrations/0010_auto_20200130_1059.py b/cookbook/migrations/0010_auto_20200130_1059.py index 5705aff4..3ef2f066 100644 --- a/cookbook/migrations/0010_auto_20200130_1059.py +++ b/cookbook/migrations/0010_auto_20200130_1059.py @@ -5,14 +5,14 @@ from django.db import migrations def migrate_ingredient_units(apps, schema_editor): Unit = apps.get_model('cookbook', 'Unit') - RecipeIngredient = apps.get_model('cookbook', 'RecipeIngredient') + RecipeIngredients = apps.get_model('cookbook', 'RecipeIngredients') - for u in RecipeIngredient.objects.values('unit').distinct(): + for u in RecipeIngredients.objects.values('unit').distinct(): unit = Unit() unit.name = u['unit'] unit.save() - for i in RecipeIngredient.objects.all(): + for i in RecipeIngredients.objects.all(): i.unit_key = Unit.objects.get(name=i.unit) i.save()