From 57658e76f5feda8e360ab4cec7297cd2065bfbc3 Mon Sep 17 00:00:00 2001 From: smilerz Date: Mon, 14 Feb 2022 17:47:17 -0600 Subject: [PATCH] fix duplicate shopping recipes when auto-add enabled --- cookbook/views/views.py | 1 + vue/src/components/MealPlanEditModal.vue | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 8a1462a25..6fefc11ab 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -12,6 +12,7 @@ from django.contrib.auth.models import Group from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from django.db.models import Avg, Q, Sum +from django.db.models.functions import Lower from django.http import HttpResponseRedirect, JsonResponse from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse, reverse_lazy diff --git a/vue/src/components/MealPlanEditModal.vue b/vue/src/components/MealPlanEditModal.vue index cb1d72434..0dc944225 100644 --- a/vue/src/components/MealPlanEditModal.vue +++ b/vue/src/components/MealPlanEditModal.vue @@ -207,8 +207,7 @@ export default { if (!cancel) { console.log("saving", { ...this.mealplan_settings, ...this.entryEditing }) this.$bvModal.hide(`edit-modal`) - this.$emit("save-entry", { ...this.mealplan_settings, ...this.entryEditing }) - console.log("after emit", { ...this.mealplan_settings, ...this.entryEditing }.addshopping) + this.$emit("save-entry", { ...this.mealplan_settings, ...this.entryEditing, ...{ addshopping: this.entryEditing.addshopping && !this.autoMealPlan } }) } }, deleteEntry() {