shopping list tweaks

This commit is contained in:
vabene1111
2020-10-20 20:54:15 +02:00
parent cb3b8c931e
commit c6f40db7e3
2 changed files with 15 additions and 2 deletions

View File

@@ -55,6 +55,13 @@ class IngredientFilter(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:
model = ShoppingList
fields = ['finished']

View File

@@ -452,7 +452,9 @@
}
}
}
if (this.shopping_list.entries.length === 0) {
this.edit_mode = true
}
}).catch((err) => {
console.log(err)
this.makeToast('{% trans 'Error' %}', '{% trans 'There was an error loading a resource!' %}' + err.bodyText, 'danger')
@@ -468,6 +470,10 @@
"created_by": 1
}
this.loading = false
if (this.shopping_list.entries.length === 0) {
this.edit_mode = true
}
}
},
updateShoppingList: function () {