diff --git a/cookbook/integration/pdfexport.py b/cookbook/integration/pdfexport.py index 9f500480..20c948a3 100644 --- a/cookbook/integration/pdfexport.py +++ b/cookbook/integration/pdfexport.py @@ -51,7 +51,7 @@ class PDFexport(Integration): await page.setCookie(cookies) await page.goto('http://'+cmd.default_addr+':'+cmd.default_port+'/view/recipe/'+str(recipe.id), {'waitUntil': 'domcontentloaded'}) - await page.waitForSelector('h3'); + await page.waitForSelector('#printReady'); files.append([recipe.name + '.pdf', await page.pdf(options)]) await page.close(); diff --git a/cookbook/views/import_export.py b/cookbook/views/import_export.py index 6e0a7b3e..9d8fec20 100644 --- a/cookbook/views/import_export.py +++ b/cookbook/views/import_export.py @@ -143,12 +143,13 @@ def export_recipe(request): ) else: + pk = '' recipe = request.GET.get('r') if recipe: if re.match(r'^([0-9])+$', recipe): - recipe = Recipe.objects.filter(pk=int(recipe), space=request.space).first() + pk = Recipe.objects.filter(pk=int(recipe), space=request.space).first().pk - return render(request, 'export.html', {'pk': recipe.pk}) + return render(request, 'export.html', {'pk': pk}) @group_required('user') diff --git a/vue/src/apps/ExportView/ExportView.vue b/vue/src/apps/ExportView/ExportView.vue index efe0538b..5db26da2 100644 --- a/vue/src/apps/ExportView/ExportView.vue +++ b/vue/src/apps/ExportView/ExportView.vue @@ -105,9 +105,10 @@ export default { } }, mounted() { - - this.insertRequested() - + if(this.export_id) + this.insertRequested() + else + this.searchRecipes('') }, methods: { diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index 7cf1932a..f4c25cd3 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -107,7 +107,7 @@