Skip to content

Commit

Permalink
issue #1178 - properly quote CSVs (handle commas) - manual migration
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Oct 8, 2024
1 parent 72293cc commit 7ec9def
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions snpdb/migrations/0151_one_off_fix_csv_export_quoting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.9 on 2024-10-08 06:29

from django.db import migrations

from manual.operations.manual_operations import ManualOperation


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

AFFECTED_GENERATORS = ["export_sample_to_downloadable_file", "export_cohort_to_downloadable_file"]
return CachedGeneratedFile.objects.filter(generator__in=AFFECTED_GENERATORS, filename__icontains='.csv').exists()


class Migration(migrations.Migration):

dependencies = [
("snpdb", "0150_rename_cachedgeneratedfile2_cachedgeneratedfile"),
]

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

0 comments on commit 7ec9def

Please sign in to comment.