mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
shopping list tweaks
This commit is contained in:
@@ -55,6 +55,13 @@ class IngredientFilter(django_filters.FilterSet):
|
|||||||
|
|
||||||
|
|
||||||
class ShoppingListFilter(django_filters.FilterSet):
|
class ShoppingListFilter(django_filters.FilterSet):
|
||||||
|
|
||||||
|
def __init__(self, data=None, *args, **kwargs):
|
||||||
|
if data is not None:
|
||||||
|
data = data.copy()
|
||||||
|
data.setdefault("finished", False)
|
||||||
|
super(ShoppingListFilter, self).__init__(data, *args, **kwargs)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ShoppingList
|
model = ShoppingList
|
||||||
fields = ['finished']
|
fields = ['finished']
|
||||||
|
|||||||
@@ -452,7 +452,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.shopping_list.entries.length === 0) {
|
||||||
|
this.edit_mode = true
|
||||||
|
}
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
|
||||||
@@ -468,6 +470,10 @@
|
|||||||
"created_by": 1
|
"created_by": 1
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
if (this.shopping_list.entries.length === 0) {
|
||||||
|
this.edit_mode = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateShoppingList: function () {
|
updateShoppingList: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user