Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JJFlorian committed Mar 26, 2024
1 parent 3ffcacf commit 85704a5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/bro_import/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def run(self) -> None:
for bro_id in bro_ids:
counter += 1
progress = (counter / total_bro_ids) * 100
self.import_task_instance.log = f"Progress: {progress:.2f}%"
self.import_task_instance.progress = round(progress, 2)
self.import_task_instance.save()

try:
Expand Down
17 changes: 17 additions & 0 deletions api/migrations/0024_importtask_progress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.1 on 2024-03-26 13:05

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("api", "0023_uploadtask_bro_id_alter_uploadtask_registration_type"),
]

operations = [
migrations.AddField(
model_name="importtask",
name="progress",
field=models.CharField(blank=True, max_length=8, null=True),
),
]
17 changes: 17 additions & 0 deletions api/migrations/0025_alter_importtask_progress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.1 on 2024-03-26 13:09

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("api", "0024_importtask_progress"),
]

operations = [
migrations.AlterField(
model_name="importtask",
name="progress",
field=models.FloatField(blank=True, null=True),
),
]
1 change: 1 addition & 0 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ImportTask(models.Model):
max_length=20, choices=choices.STATUS_CHOICES, default="PENDING", blank=True
)
log = models.TextField(blank=True)
progress = models.FloatField(blank=True, null=True)

def __str__(self):
return f"{self.bro_domain} import - {self.data_owner}"
Expand Down

0 comments on commit 85704a5

Please sign in to comment.