mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 14:49:49 -04:00
Stop defaulting simple_polygons to empty array
This is now done by the Admin app [1].
[1]: baf20e0075
This commit is contained in:
@@ -2336,9 +2336,6 @@ class BroadcastMessage(db.Model):
|
|||||||
self._personalisation = encryption.encrypt(personalisation or {})
|
self._personalisation = encryption.encrypt(personalisation or {})
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
areas = dict(self.areas)
|
|
||||||
areas["simple_polygons"] = areas.get("simple_polygons", [])
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': str(self.id),
|
'id': str(self.id),
|
||||||
'reference': self.reference,
|
'reference': self.reference,
|
||||||
@@ -2351,7 +2348,7 @@ class BroadcastMessage(db.Model):
|
|||||||
'personalisation': self.personalisation if self.template else None,
|
'personalisation': self.personalisation if self.template else None,
|
||||||
'content': self.content,
|
'content': self.content,
|
||||||
|
|
||||||
'areas': areas,
|
'areas': self.areas,
|
||||||
'status': self.status,
|
'status': self.status,
|
||||||
|
|
||||||
'starts_at': get_dt_string_or_none(self.starts_at),
|
'starts_at': get_dt_string_or_none(self.starts_at),
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ def test_create_broadcast_message(admin_request, sample_broadcast_service, train
|
|||||||
assert response['created_at'] is not None
|
assert response['created_at'] is not None
|
||||||
assert response['created_by_id'] == str(t.created_by_id)
|
assert response['created_by_id'] == str(t.created_by_id)
|
||||||
assert response['personalisation'] == {}
|
assert response['personalisation'] == {}
|
||||||
assert response['areas']['simple_polygons'] == []
|
assert response['areas'] == {}
|
||||||
assert response['content'] == 'Some content\n€ŷŵ~\n\'\'""---'
|
assert response['content'] == 'Some content\n€ŷŵ~\n\'\'""---'
|
||||||
|
|
||||||
broadcast_message = dao_get_broadcast_message_by_id_and_service_id(response["id"], sample_broadcast_service.id)
|
broadcast_message = dao_get_broadcast_message_by_id_and_service_id(response["id"], sample_broadcast_service.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user