diff --git a/bookwyrm/goodreads_import.py b/bookwyrm/goodreads_import.py index 9b8a4f01..5c982764 100644 --- a/bookwyrm/goodreads_import.py +++ b/bookwyrm/goodreads_import.py @@ -69,3 +69,5 @@ def import_data(job_id): item.save() finally: create_notification(job.user, 'IMPORT', related_import=job) + job.complete = True + job.save() diff --git a/bookwyrm/migrations/0034_importjob_complete.py b/bookwyrm/migrations/0034_importjob_complete.py new file mode 100644 index 00000000..14170607 --- /dev/null +++ b/bookwyrm/migrations/0034_importjob_complete.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2021-01-07 16:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0033_siteinvite_created_date'), + ] + + operations = [ + migrations.AddField( + model_name='importjob', + name='complete', + field=models.BooleanField(default=False), + ), + ] diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 1ebe9b31..b10651b9 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -42,6 +42,7 @@ class ImportJob(models.Model): created_date = models.DateTimeField(default=timezone.now) task_id = models.CharField(max_length=100, null=True) include_reviews = models.BooleanField(default=True) + complete = models.BooleanField(default=False) privacy = models.CharField( max_length=255, default='public', diff --git a/bookwyrm/templates/import_status.html b/bookwyrm/templates/import_status.html index 6bb903b0..077cd3fb 100644 --- a/bookwyrm/templates/import_status.html +++ b/bookwyrm/templates/import_status.html @@ -8,7 +8,7 @@

Import started: {{ job.created_date | naturaltime }}

- {% if task.successful %} + {% if job.complete %}

Import completed: {{ task.date_done | naturaltime }}