Remove support for old "areas" sub-field

All broadcasts with this field have now been migrated to use "ids".

This also removes a few lines that were missed in previous PRs:

- Added by mistake: fd7ebbebb0 (diff-045554136e1462693a6cbb6328b2e056a81e8b348e94575edd8f72b78c5da96eR115)
- Missed removal: ec1171f85c (diff-045554136e1462693a6cbb6328b2e056a81e8b348e94575edd8f72b78c5da96eR110)
This commit is contained in:
Ben Thorner
2021-09-06 12:28:47 +01:00
parent 6af39c4d3b
commit dd41cf854c
3 changed files with 3 additions and 18 deletions

View File

@@ -2336,10 +2336,9 @@ class BroadcastMessage(db.Model):
self._personalisation = encryption.encrypt(personalisation or {})
def serialize(self):
# TEMPORARY: while we repurpose "areas"
areas = dict(self.areas)
areas["simple_polygons"] = areas.get("simple_polygons", [])
areas["ids"] = areas.pop("areas", areas.get("ids", []))
areas["ids"] = areas.get("ids", [])
return {
'id': str(self.id),