diff --git a/cookbook/integration/default.py b/cookbook/integration/default.py index 5939b5f4..890caad5 100644 --- a/cookbook/integration/default.py +++ b/cookbook/integration/default.py @@ -58,7 +58,7 @@ class Default(Integration): try: recipe_zip_obj.writestr(f'image{get_filetype(r.image.file.name)}', r.image.file.read()) - except ValueError: + except (ValueError, FileNotFoundError): pass recipe_zip_obj.close() @@ -71,4 +71,4 @@ class Default(Integration): export_zip_obj.close() - return [[ self.get_export_file_name(), export_zip_stream.getvalue() ]] \ No newline at end of file + return [[self.get_export_file_name(), export_zip_stream.getvalue()]] diff --git a/cookbook/integration/integration.py b/cookbook/integration/integration.py index a7e58685..7386b50d 100644 --- a/cookbook/integration/integration.py +++ b/cookbook/integration/integration.py @@ -37,7 +37,6 @@ class Integration: self.ignored_recipes = [] description = f'Imported by {request.user.get_user_display_name()} at {date_format(datetime.datetime.now(), "DATETIME_FORMAT")}. Type: {export_type}' - icon = '📥' try: last_kw = Keyword.objects.filter(name__regex=r'^(Import [0-9]+)', space=request.space).latest('created_at') @@ -50,14 +49,12 @@ class Integration: self.keyword = parent.add_child( name=name, description=description, - icon=icon, space=request.space ) except (IntegrityError, ValueError): # in case, for whatever reason, the name does exist append UUID to it. Not nice but works for now. self.keyword = parent.add_child( name=f'{name} {str(uuid.uuid4())[0:8]}', description=description, - icon=icon, space=request.space ) diff --git a/cookbook/views/import_export.py b/cookbook/views/import_export.py index 1d2bcfc6..b80de200 100644 --- a/cookbook/views/import_export.py +++ b/cookbook/views/import_export.py @@ -2,7 +2,7 @@ import re import threading from django.core.cache import cache -from django.http import HttpResponseRedirect, JsonResponse +from django.http import HttpResponse, JsonResponse from django.shortcuts import get_object_or_404, render from django.utils.translation import gettext as _ diff --git a/vue/src/apps/ExportView/ExportView.vue b/vue/src/apps/ExportView/ExportView.vue index 96a3dd1b..d951e423 100644 --- a/vue/src/apps/ExportView/ExportView.vue +++ b/vue/src/apps/ExportView/ExportView.vue @@ -18,25 +18,6 @@ {{ $t("All recipes") }} - { - StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err) + StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err) }) - // .then((e) => this.searchRecipes("")) }, - // searchRecipes: function (query) { - // this.recipes_loading = true - - // this.genericAPI(this.Models.RECIPE, this.Actions.LIST, { query: query }) - // .then((response) => { - // this.recipes = response.data.results - // this.recipes_loading = false - // }) - // .catch((err) => { - // console.log(err) - // StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH) - // }) - // }, - exportRecipe: function () { if (this.recipe_list.length < 1 && this.export_all == false && this.filter === undefined) { makeToast(this.$t("Error"), this.$t("Select at least one recipe"), "danger") @@ -148,7 +108,7 @@ export default { let formData = new FormData() formData.append("type", this.recipe_app) formData.append("all", this.export_all) - formData.append("filter", this.filter?.id ?? null) + formData.append("custom_filter", this.filter?.id ?? null) for (var i = 0; i < this.recipe_list.length; i++) { formData.append("recipes", this.recipe_list[i].id)