diff --git a/bookwyrm/templates/import_status.html b/bookwyrm/templates/import_status.html index e4eb681e..d091e303 100644 --- a/bookwyrm/templates/import_status.html +++ b/bookwyrm/templates/import_status.html @@ -26,7 +26,24 @@ {% endif %} +{% if failed_items %}
+

Failed to load

+ +
+{% endif %} + +
+

Successfully imported

diff --git a/bookwyrm/views.py b/bookwyrm/views.py index 771e6a85..b40a75a7 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -209,10 +209,14 @@ def import_status(request, job_id): if job.user != request.user: raise PermissionDenied task = app.AsyncResult(job.task_id) + 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] return TemplateResponse(request, 'import_status.html', { 'title': 'Import Status', 'job': job, - 'items': job.items.order_by('index').all(), + 'items': items, + 'failed_items': failed_items, 'task': task })
@@ -57,9 +74,10 @@ {{ item.data|dict_key:'Author' }} - {% if item.book %}✓ - {% elif item.fail_reason %} - {{ item.fail_reason }} + {% if item.book %} + + Imported + {% endif %}