From 0bccb8a1e2854bc1726402d33bf54bbb2a69f058 Mon Sep 17 00:00:00 2001 From: JSv4 Date: Sun, 3 Nov 2024 13:19:17 -0800 Subject: [PATCH] Set default corrected_data property on DataCell to None. --- .../extracts/datagrid/ExtractCellEditor.tsx | 5 ----- .../0015_alter_datacell_corrected_data.py | 21 +++++++++++++++++++ opencontractserver/extracts/models.py | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 opencontractserver/extracts/migrations/0015_alter_datacell_corrected_data.py diff --git a/frontend/src/components/extracts/datagrid/ExtractCellEditor.tsx b/frontend/src/components/extracts/datagrid/ExtractCellEditor.tsx index 78d36507..96bbaf0f 100644 --- a/frontend/src/components/extracts/datagrid/ExtractCellEditor.tsx +++ b/frontend/src/components/extracts/datagrid/ExtractCellEditor.tsx @@ -20,11 +20,6 @@ interface ExtractCellEditorProps { extractIsList: boolean; } -interface JsonEdit { - updated_src: any; - // You can add other properties if needed -} - export const ExtractCellEditor: React.FC = ({ row, column, diff --git a/opencontractserver/extracts/migrations/0015_alter_datacell_corrected_data.py b/opencontractserver/extracts/migrations/0015_alter_datacell_corrected_data.py new file mode 100644 index 00000000..fbd45a86 --- /dev/null +++ b/opencontractserver/extracts/migrations/0015_alter_datacell_corrected_data.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.16 on 2024-11-03 21:06 + +from django.db import migrations +import opencontractserver.shared.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("extracts", "0014_extract_corpus_action"), + ] + + operations = [ + migrations.AlterField( + model_name="datacell", + name="corrected_data", + field=opencontractserver.shared.fields.NullableJSONField( + blank=True, default=None, null=True + ), + ), + ] diff --git a/opencontractserver/extracts/models.py b/opencontractserver/extracts/models.py index 9c6fa386..5aada5b7 100644 --- a/opencontractserver/extracts/models.py +++ b/opencontractserver/extracts/models.py @@ -182,7 +182,7 @@ class Datacell(BaseOCModel): related_name="rejected_cells", ) corrected_data = NullableJSONField( - default=jsonfield_default_value, null=True, blank=True + default=None, null=True, blank=True ) class Meta: