Merge branch 'develop' into feature/shopping-ui

This commit is contained in:
vabene1111 2024-01-28 08:32:31 +01:00
commit 67f6e04680
4 changed files with 14 additions and 12 deletions

View File

@ -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',

View File

@ -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',

View File

@ -1719,10 +1719,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()

View File

@ -62,7 +62,7 @@
</div>
</div>
<b-modal id="ingredient_edit_modal" :title="$t('Edit')" @hidden="destroyIngredientEditModal">
<b-modal id="ingredient_edit_modal" ref="ingredient_edit_modal" :title="$t('Edit')" @hidden="destroyIngredientEditModal">
<div v-if="current_edit_ingredient !== null">
<b-form-group v-bind:label="$t('Original_Text')" class="mb-3">
<b-form-input v-model="current_edit_ingredient.original_text" type="text" disabled></b-form-input>
@ -88,8 +88,8 @@
<div class="row w-100">
<div class="col-auto justify-content-end">
<b-button class="mx-1" >{{ $t('Ok') }}</b-button>
<b-button class="mx-1" @click="removeIngredient(current_edit_step,current_edit_ingredient);" variant="danger">{{ $t('Delete') }}</b-button>
<b-button class="mx-1" @click="destroyIngredientEditModal()">{{ $t('Ok') }}</b-button>
<b-button class="mx-1" @click="removeIngredient(current_edit_step,current_edit_ingredient);destroyIngredientEditModal()" variant="danger">{{ $t('Delete') }}</b-button>
</div>
</div>
</template>