Skip to content

Commit

Permalink
Merge branch 'hotfix/1.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Nov 21, 2024
2 parents 24b67f7 + 2fe287e commit 6b9a9ef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

1.7.2
-----

- bugfix: include address location name in member address data export

1.7.1
-----

Expand Down
2 changes: 1 addition & 1 deletion mep/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.7.1"
__version__ = "1.7.2"


# context processor to add version to the template environment
Expand Down
1 change: 1 addition & 0 deletions mep/accounts/management/commands/export_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def get_object_data(self, obj):
care_of_person_id=obj.care_of_person.slug if obj.care_of_person else None,
care_of_person_name=obj.care_of_person.name if obj.care_of_person else None,
# Location data
location_name=loc.name.strip(),
street_address=loc.street_address,
city=loc.city,
postal_code=loc.postal_code,
Expand Down
9 changes: 9 additions & 0 deletions mep/accounts/tests/test_accounts_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@ def test_get_object_data(self):
assert gay_data["start_date"] == "1919-01-01"
assert gay_data["end_date"] == "1930-01-01"
assert gay_data["care_of_person_id"] == "hemingway"
# location does not have a name
assert gay_data["location_name"] == ""

# without dates
self.cmd.include_dates = False
Expand All @@ -684,3 +686,10 @@ def test_get_object_data(self):
assert gay_data["members"][0]["sort_name"] == "Gay, Francisque"
assert gay_data["care_of_person_id"] == "hemingway"
assert gay_data["care_of_person_name"] == "Ernest Hemingway"

# add a location name to confirm it is included
loc = address.location
loc.name = "Le Hotel"
loc.save()
gay_data = self.cmd.get_object_data(address)
assert gay_data["location_name"] == loc.name

0 comments on commit 6b9a9ef

Please sign in to comment.