mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #1116 from bookwyrm-social/import-async-error
Don't error when task for import no longer exists
This commit is contained in:
commit
ea56d42906
1 changed files with 4 additions and 1 deletions
|
@ -81,7 +81,10 @@ class ImportStatus(View):
|
|||
job = models.ImportJob.objects.get(id=job_id)
|
||||
if job.user != request.user:
|
||||
raise PermissionDenied
|
||||
task = app.AsyncResult(job.task_id)
|
||||
try:
|
||||
task = app.AsyncResult(job.task_id)
|
||||
except ValueError:
|
||||
task = None
|
||||
items = job.items.order_by("index").all()
|
||||
failed_items = [i for i in items if i.fail_reason]
|
||||
items = [i for i in items if not i.fail_reason]
|
||||
|
|
Loading…
Reference in a new issue