mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
Merge branch 'develop' into feature/shopping-ui
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user