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

Correct the ordering of the address to put the country last

parent 8f96901a
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,16 @@ class AddressFieldBlock(ApplicationMustIncludeFieldBlock): ...@@ -47,8 +47,16 @@ class AddressFieldBlock(ApplicationMustIncludeFieldBlock):
icon = 'home' icon = 'home'
def format_data(self, data): def format_data(self, data):
# Based on the fields listed in addressfields/widgets.py
order_fields = [
'thoroughfare', 'premise', 'localityname', 'administrativearea', 'postalcode', 'country'
]
address = json.loads(data) address = json.loads(data)
return ', '.join(address.values()) return ', '.join(
address[field]
for field in order_fields
if address[field]
)
class FullNameBlock(ApplicationMustIncludeFieldBlock): class FullNameBlock(ApplicationMustIncludeFieldBlock):
......
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