From e13ddb10d0f94b105f5ef8eefb10b8912a4836cf Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 28 Jun 2021 13:50:04 -0700 Subject: [PATCH] Avoids template errors in dev when imports can't connect to redis --- bookwyrm/views/import_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/views/import_data.py b/bookwyrm/views/import_data.py index b2b88a2e..70b9f89d 100644 --- a/bookwyrm/views/import_data.py +++ b/bookwyrm/views/import_data.py @@ -84,7 +84,9 @@ class ImportStatus(View): try: task = app.AsyncResult(job.task_id) - except ValueError: + # triggers attribute error if the task won't load + task.status # pylint: disable=pointless-statement + except (ValueError, AttributeError): task = None items = job.items.order_by("index").all()