Skip to content
Snippets Groups Projects
Commit f377db60 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Fix bug where the addressfield data wasnt being stored

parent 54051309
No related branches found
No related tags found
No related merge requests found
...@@ -49,4 +49,13 @@ class AddressField(forms.CharField): ...@@ -49,4 +49,13 @@ class AddressField(forms.CharField):
missing_field_name = [fields[field]['label'] for field in missing_fields] missing_field_name = [fields[field]['label'] for field in missing_fields]
raise ValidationError('Please provide data for: {}'.format(', '.join(missing_field_name))) raise ValidationError('Please provide data for: {}'.format(', '.join(missing_field_name)))
super().clean(value, **kwargs) return super().clean(value, **kwargs)
def to_python(self, value):
return json.dumps(value)
def prepare_value(self, value):
try:
return json.loads(value)
except TypeError:
return value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment