From 190f63abf8c66e0d4c562b7dbfc3769dcd5bc9be Mon Sep 17 00:00:00 2001 From: Anna Sidwell Date: Fri, 5 Oct 2018 09:29:24 -0400 Subject: [PATCH] Attempt a different migration to remove null from text fields --- apps/map/migrations/0069_remove_null_from_text_fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/map/migrations/0069_remove_null_from_text_fields.py b/apps/map/migrations/0069_remove_null_from_text_fields.py index c628a70..99b2ae4 100644 --- a/apps/map/migrations/0069_remove_null_from_text_fields.py +++ b/apps/map/migrations/0069_remove_null_from_text_fields.py @@ -62,7 +62,7 @@ def remove_nulls(apps, schema_editor): study = apps.get_model('map', 'CaseStudy') for study in CaseStudy.objects.all(): for field in string_fields: - if study._meta.get_field(field) == None: + if getattr(study, field) == None: setattr(study, field, '') study.save()