From 39209f516189d11ee0d4643a1b6b9acd586601e1 Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Thu, 11 Aug 2022 15:57:06 +0200 Subject: [PATCH] Use asyncio.run for running PDF generation --- aleksis/core/util/pdf.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aleksis/core/util/pdf.py b/aleksis/core/util/pdf.py index f275cc806..880cbb01e 100644 --- a/aleksis/core/util/pdf.py +++ b/aleksis/core/util/pdf.py @@ -64,9 +64,7 @@ def generate_pdf( pdf_path = os.path.join(temp_dir, "print.pdf") lang = lang or get_language() - asyncio.get_event_loop().run_until_complete( - _generate_pdf_with_chromium(temp_dir, pdf_path, html_url, lang) - ) + asyncio.run(_generate_pdf_with_chromium(temp_dir, pdf_path, html_url, lang)) # Upload PDF file to media storage with open(pdf_path, "rb") as f: -- GitLab