mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 23:08:25 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -7,11 +7,12 @@ from django.db import migrations, models
|
|||
|
||||
def populate_status(apps, schema_editor):
|
||||
from funkwhale_api.music.utils import compute_status
|
||||
|
||||
ImportBatch = apps.get_model("music", "ImportBatch")
|
||||
|
||||
for ib in ImportBatch.objects.prefetch_related('jobs'):
|
||||
for ib in ImportBatch.objects.prefetch_related("jobs"):
|
||||
ib.status = compute_status(ib.jobs.all())
|
||||
ib.save(update_fields=['status'])
|
||||
ib.save(update_fields=["status"])
|
||||
|
||||
|
||||
def rewind(apps, schema_editor):
|
||||
|
@ -20,10 +21,6 @@ def rewind(apps, schema_editor):
|
|||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('music', '0020_importbatch_status'),
|
||||
]
|
||||
dependencies = [("music", "0020_importbatch_status")]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(populate_status, rewind),
|
||||
]
|
||||
operations = [migrations.RunPython(populate_status, rewind)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue