From 9a67c61487a2294db2d22d1f8a910fd5a4426e12 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 14 Jun 2021 11:59:44 -0700 Subject: [PATCH] Clarifies wording on pending imports Fixes #1118 --- bookwyrm/templates/import_status.html | 5 +++++ bookwyrm/views/import_data.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/import_status.html b/bookwyrm/templates/import_status.html index ff80ad71..11ff47f1 100644 --- a/bookwyrm/templates/import_status.html +++ b/bookwyrm/templates/import_status.html @@ -7,6 +7,7 @@ {% block content %}{% spaceless %}

{% trans "Import Status" %}

+ {% trans "Back to imports" %}
@@ -106,7 +107,11 @@ {% endif %}
+ {% if job.complete %}

{% trans "Successfully imported" %}

+ {% else %} +

{% trans "Import Progress" %}

+ {% endif %}
diff --git a/bookwyrm/views/import_data.py b/bookwyrm/views/import_data.py index 62dcce73..b2b88a2e 100644 --- a/bookwyrm/views/import_data.py +++ b/bookwyrm/views/import_data.py @@ -78,13 +78,15 @@ class ImportStatus(View): def get(self, request, job_id): """status of an import job""" - job = models.ImportJob.objects.get(id=job_id) + job = get_object_or_404(models.ImportJob, id=job_id) if job.user != request.user: raise PermissionDenied + 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]