mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-24 02:21:04 +00:00
Adds field on import job to check if job completed
the task isn't a reliable indicator, unfortunately.
This commit is contained in:
parent
e60a984bea
commit
d04271af75
4 changed files with 22 additions and 1 deletions
|
@ -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()
|
||||
|
|
18
bookwyrm/migrations/0034_importjob_complete.py
Normal file
18
bookwyrm/migrations/0034_importjob_complete.py
Normal file
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -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',
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<p>
|
||||
Import started: {{ job.created_date | naturaltime }}
|
||||
</p>
|
||||
{% if task.successful %}
|
||||
{% if job.complete %}
|
||||
<p>
|
||||
Import completed: {{ task.date_done | naturaltime }}
|
||||
</p>
|
||||
|
|
Loading…
Reference in a new issue