Skip to content

Commit

Permalink
issue #1177 - Give failed runs another go
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Oct 8, 2024
1 parent 7ec9def commit e429b8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snpdb/migrations/0151_one_off_fix_csv_export_quoting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
from manual.operations.manual_operations import ManualOperation


def _delete_failed_csv_exports(apps, _schema_editor):
CachedGeneratedFile = apps.get_model("snpdb", "CachedGeneratedFile")
AFFECTED_GENERATORS = ["export_sample_to_downloadable_file", "export_cohort_to_downloadable_file"]
CachedGeneratedFile.objects.filter(generator__in=AFFECTED_GENERATORS, exception__contains='NoneType').delete()


def _test_for_csv_export(apps):
CachedGeneratedFile = apps.get_model("snpdb", "CachedGeneratedFile")

Expand All @@ -19,6 +25,7 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(_delete_failed_csv_exports),
ManualOperation(task_id=ManualOperation.task_id_manage(["one_off_fix_csv_export_quoting"]),
test=_test_for_csv_export)
]

0 comments on commit e429b8f

Please sign in to comment.