Attempt a different migration to remove null from text fields
This commit is contained in:
parent
6220f62af3
commit
190f63abf8
@ -62,7 +62,7 @@ def remove_nulls(apps, schema_editor):
|
|||||||
study = apps.get_model('map', 'CaseStudy')
|
study = apps.get_model('map', 'CaseStudy')
|
||||||
for study in CaseStudy.objects.all():
|
for study in CaseStudy.objects.all():
|
||||||
for field in string_fields:
|
for field in string_fields:
|
||||||
if study._meta.get_field(field) == None:
|
if getattr(study, field) == None:
|
||||||
setattr(study, field, '')
|
setattr(study, field, '')
|
||||||
|
|
||||||
study.save()
|
study.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user