Merge pull request #1204 from bookwyrm-social/dev-import-bug

Avoids template errors in dev when imports can't connect to redis
This commit is contained in:
Mouse Reeve 2021-06-28 14:26:23 -07:00 committed by GitHub
commit 088c862e90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()