File indexing completed on 2026-06-26 08:40:25
0001 from django.db import migrations
0002
0003
0004 def csv_import_into_draft(apps, schema_editor):
0005 """Pull every imported catalog row into the editable production lifecycle.
0006
0007 The CSV import exists to turn Sakib's static ``default_datasets.csv`` list
0008 into the living, actionable current-campaign catalog, so those rows belong
0009 in the buildable flow from the start. The legacy ``csv_import`` holding
0010 status (and the per-row Adopt step) are retired: status ``csv_import`` →
0011 ``draft``, owned by wenaus. ``past_output`` archives are untouched.
0012
0013 Idempotent: re-running matches nothing once the flip has happened.
0014 """
0015 ProdTask = apps.get_model('pcs', 'ProdTask')
0016 ProdTask.objects.filter(status='csv_import').update(
0017 status='draft', created_by='wenaus',
0018 )
0019
0020
0021 class Migration(migrations.Migration):
0022
0023 dependencies = [
0024 ('pcs', '0007_alter_campaign_lifecycle_alter_prodrequest_status_and_more'),
0025 ]
0026
0027
0028
0029 operations = [
0030 migrations.RunPython(csv_import_into_draft, migrations.RunPython.noop),
0031 ]