From d10c70b797fb6146b19d9b38fa596715fd21f98a Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 28 Jan 2024 08:21:57 +0100 Subject: [PATCH 1/3] fixed iCal endpoint --- cookbook/views/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 98b4d9bc..59e40564 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -1686,10 +1686,10 @@ def get_plan_ical(request, from_date, to_date): ).filter(space=request.user.userspace_set.filter(active=1).first().space).distinct().all() if from_date is not None: - queryset = queryset.filter(date__gte=from_date) + queryset = queryset.filter(from_date__gte=from_date) if to_date is not None: - queryset = queryset.filter(date__lte=to_date) + queryset = queryset.filter(to_date__lte=to_date) cal = Calendar() From 126e8a5a53e5c5ef4804d4a129b701395571a15f Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 28 Jan 2024 08:22:04 +0100 Subject: [PATCH 2/3] fixed FDC migration --- cookbook/migrations/0204_propertytype_fdc_id.py | 6 ------ ...0205_alter_food_fdc_id_alter_propertytype_fdc_id.py | 10 +++++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cookbook/migrations/0204_propertytype_fdc_id.py b/cookbook/migrations/0204_propertytype_fdc_id.py index 70598463..e57dea39 100644 --- a/cookbook/migrations/0204_propertytype_fdc_id.py +++ b/cookbook/migrations/0204_propertytype_fdc_id.py @@ -4,11 +4,6 @@ from django.db import migrations, models from django_scopes import scopes_disabled -def fix_fdc_ids(apps, schema_editor): - with scopes_disabled(): - # in case any food had a non digit fdc ID before this migration, remove it - Food = apps.get_model('cookbook', 'Food') - Food.objects.exclude(fdc_id__regex=r'^\d+$').exclude(fdc_id=None).update(fdc_id=None) class Migration(migrations.Migration): @@ -17,7 +12,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(fix_fdc_ids), migrations.AddField( model_name='propertytype', name='fdc_id', diff --git a/cookbook/migrations/0205_alter_food_fdc_id_alter_propertytype_fdc_id.py b/cookbook/migrations/0205_alter_food_fdc_id_alter_propertytype_fdc_id.py index 9f57e443..96b19f26 100644 --- a/cookbook/migrations/0205_alter_food_fdc_id_alter_propertytype_fdc_id.py +++ b/cookbook/migrations/0205_alter_food_fdc_id_alter_propertytype_fdc_id.py @@ -1,15 +1,23 @@ # Generated by Django 4.2.7 on 2023-11-29 19:44 from django.db import migrations, models +from django_scopes import scopes_disabled + + +def fix_fdc_ids(apps, schema_editor): + with scopes_disabled(): + # in case any food had a non digit fdc ID before this migration, remove it + Food = apps.get_model('cookbook', 'Food') + Food.objects.exclude(fdc_id__regex=r'^\d+$').exclude(fdc_id=None).update(fdc_id=None) class Migration(migrations.Migration): - dependencies = [ ('cookbook', '0204_propertytype_fdc_id'), ] operations = [ + migrations.RunPython(fix_fdc_ids), migrations.AlterField( model_name='food', name='fdc_id', From fb8ca5228095ff61a9ed5bdf6d59eedd4a56e26f Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 28 Jan 2024 08:31:55 +0100 Subject: [PATCH 3/3] hide ingredient edit modal --- vue/src/apps/ImportView/ImportViewStepEditor.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vue/src/apps/ImportView/ImportViewStepEditor.vue b/vue/src/apps/ImportView/ImportViewStepEditor.vue index 0d0ff94e..cbf2432a 100644 --- a/vue/src/apps/ImportView/ImportViewStepEditor.vue +++ b/vue/src/apps/ImportView/ImportViewStepEditor.vue @@ -62,7 +62,7 @@ - +
@@ -88,8 +88,8 @@
- {{ $t('Ok') }} - {{ $t('Delete') }} + {{ $t('Ok') }} + {{ $t('Delete') }}