-
Notifications
You must be signed in to change notification settings - Fork 3
Postcode logging #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Postcode logging #620
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"polling_station_known": false, | ||
"postcode_location": { | ||
"type": "Feature", | ||
"properties": { | ||
"postcode": "AA1 4AA" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0.008211636363636364, | ||
51.46623861363635 | ||
] | ||
} | ||
}, | ||
"council": { | ||
"url": "http://127.0.0.1:8001/api/beta/councils/LEW/", | ||
"council_id": "LEW", | ||
"name": "London Borough of Lewisham", | ||
"nation": "England", | ||
"email": "electoral.services@lewisham.gov.uk", | ||
"phone": "020 8314 6086", | ||
"website": "http://www.lewisham.gov.uk/", | ||
"postcode": "SE6 4RU", | ||
"address": "Electoral Registration Officer\nLewisham Town Hall\nCatford Road\nCatford", | ||
"identifiers": [ | ||
"E09000023" | ||
] | ||
}, | ||
"polling_station": null, | ||
"advance_voting_station": null, | ||
"addresses": [ | ||
{ | ||
"url": "http://127.0.0.1:8000/api/beta/address/1-foo-street-bar-town/", | ||
"address": "1 Foo St., Bar Town", | ||
"postcode": "AA1 4AA", | ||
"council": "London Borough of Lewisham", | ||
"polling_station_id": "", | ||
"uprn": "1-foo-street-bar-town" | ||
} | ||
], | ||
"report_problem_url": null, | ||
"metadata": null, | ||
"ballots": [ | ||
{ | ||
"ballot_paper_id": "mayor.lewisham.2018-05-03", | ||
"ballot_title": "Mayor of Lewisham election", | ||
"poll_open_date": "2018-05-03", | ||
"elected_role": "Mayor of Lewisham", | ||
"metadata": null, | ||
"cancelled": false, | ||
"cancellation_reason": null, | ||
"replaced_by": null, | ||
"replaces": null, | ||
"requires_voter_id": "EA-2022" | ||
}, | ||
{ | ||
"ballot_paper_id": "local.lewisham.blackheath.2018-05-03", | ||
"ballot_title": "Lewisham local election Blackheath", | ||
"poll_open_date": "2018-05-03", | ||
"elected_role": "Local Councillor", | ||
"metadata": null, | ||
"cancelled": true, | ||
"cancellation_reason": "UNDER_CONTESTED", | ||
"replaced_by": "local.lewisham.blackheath.2018-05-10", | ||
"replaces": null, | ||
"requires_voter_id": "EA-2022" | ||
}, | ||
{ | ||
"ballot_paper_id": "local.lewisham.blackheath.2018-05-10", | ||
"ballot_title": "Lewisham local election Blackheath", | ||
"poll_open_date": "2018-05-10", | ||
"elected_role": "Local Councillor", | ||
"metadata": null, | ||
"cancelled": false, | ||
"cancellation_reason": null, | ||
"replaced_by": null, | ||
"replaces": "local.lewisham.blackheath.2018-05-03", | ||
"requires_voter_id": "EA-2022" | ||
}, | ||
{ | ||
"ballot_paper_id": "parl.lewisham-east.by.2018-06-14", | ||
"ballot_title": "Lewisham East by-election", | ||
"poll_open_date": "2018-06-14", | ||
"elected_role": "Member of Parliament", | ||
"metadata": null, | ||
"cancelled": false, | ||
"cancellation_reason": null, | ||
"replaced_by": null, | ||
"replaces": null, | ||
"requires_voter_id": "EA-2022" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"polling_station_known": false, | ||
"postcode_location": { | ||
"type": "Feature", | ||
"properties": { | ||
"postcode": "AA1 1AA" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-0.13447605, | ||
51.489488200000004 | ||
] | ||
} | ||
}, | ||
"council": { | ||
"url": "https://wheredoivote.co.uk/api/beta/councils/WSM/", | ||
"council_id": "WSM", | ||
"name": "City of Westminster", | ||
"nation": "England", | ||
"email": "electoralservices@westminster.gov.uk", | ||
"phone": "020 7641 2730", | ||
"website": "http://www.westminster.gov.uk/", | ||
"postcode": "WC2N 5HR", | ||
"address": "Electoral Registration Officer\nWestminster City Council\n2nd Floor, City Hall\n5 Strand", | ||
"identifiers": [ | ||
"E09000033" | ||
] | ||
}, | ||
"polling_station": null, | ||
"advance_voting_station": null, | ||
"addresses": [ | ||
{ | ||
"url": "http://127.0.0.1:8000/api/beta/address/1-foo-street-bar-town/", | ||
"address": "1 Foo St., Bar Town", | ||
"postcode": "AA1 1AA", | ||
"council": "City of Westminster", | ||
"polling_station_id": "", | ||
"uprn": "1-foo-street-bar-town" | ||
} | ||
], | ||
"report_problem_url": null, | ||
"metadata": null, | ||
"ballots": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"polling_station_known": true, | ||
"postcode_location": { | ||
"type": "Feature", | ||
"properties": { | ||
"postcode": "AA1 2AA" | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-0.1804843, | ||
51.5113775 | ||
] | ||
} | ||
}, | ||
"council": { | ||
"url": "https://wheredoivote.co.uk/api/beta/councils/WSM/", | ||
"council_id": "WSM", | ||
"name": "City of Westminster", | ||
"nation": "England", | ||
"email": "electoralservices@westminster.gov.uk", | ||
"phone": "020 7641 2730", | ||
"website": "http://www.westminster.gov.uk/", | ||
"postcode": "WC2N 5HR", | ||
"address": "Electoral Registration Officer\nWestminster City Council\n2nd Floor, City Hall\n5 Strand", | ||
"identifiers": [ | ||
"E09000033" | ||
] | ||
}, | ||
"polling_station": { | ||
"id": "E09000033.39-york-room-lancaster-hall-hotel", | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-0.1785134375, | ||
51.512779025 | ||
] | ||
}, | ||
"properties": { | ||
"urls": { | ||
"detail": "http://127.0.0.1:8001/api/beta/pollingstations/?council_id=E09000033&station_id=39-york-room-lancaster-hall-hotel", | ||
"geo": "http://127.0.0.1:8001/api/beta/pollingstations/geo/?council_id=E09000033&station_id=39-york-room-lancaster-hall-hotel" | ||
}, | ||
"council": "http://127.0.0.1:8001/api/beta/councils/E09000033/", | ||
"station_id": "39-york-room-lancaster-hall-hotel", | ||
"postcode": "W2 3EL", | ||
"address": "York Room, Lancaster Hall Hotel\n35 Craven Terrace\nLondon" | ||
} | ||
}, | ||
"advance_voting_station": { | ||
"name": "Exeter Guildhall", | ||
"address": "Exeter City Council\nCivic Centre\nParis Street\nExeter\nDevon", | ||
"postcode": "EX1 1JN", | ||
"location": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-3.524551005678706, | ||
50.72486002944331 | ||
] | ||
}, | ||
"opening_times": [ | ||
[ | ||
"2018-11-20", | ||
"10:00:00", | ||
"16:00:00" | ||
], | ||
[ | ||
"2018-11-21", | ||
"10:00:00", | ||
"16:00:00" | ||
] | ||
] | ||
}, | ||
"addresses": [ | ||
{ | ||
"url": "http://127.0.0.1:8000/api/beta/address/1-foo-street-bar-town/", | ||
"address": "1 Foo St., Bar Town", | ||
"postcode": "AA1 2AA", | ||
"council": "City of Westminster", | ||
"polling_station_id": "", | ||
"uprn": "1-foo-street-bar-town" | ||
} | ||
], | ||
"report_problem_url": "https://wheredoivote.co.uk/report_problem/?source=testing&source_url=testing", | ||
"metadata": null, | ||
"ballots": [ | ||
{ | ||
"ballot_paper_id": "local.westminster.lancaster-gate.by.2018-11-22", | ||
"ballot_title": "Westminster local election Lancaster Gate by-election", | ||
"poll_open_date": "2018-11-22", | ||
"elected_role": "Local Councillor", | ||
"metadata": null, | ||
"cancelled": false, | ||
"cancellation_reason": null, | ||
"replaced_by": null, | ||
"replaces": null, | ||
"requires_voter_id": "EA-2022" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very defensive, but I figure we don't want to fall over here because there wasn't a
postcode_location
orproperties
object.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment from the EC API. We don't want to log
None
postcodes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I wasn't sure which way to go. I think we shouldn't end up logging
None
postcodes because we should always have a postcode from WDIV. If this broke then I was thinking that logging them was a good way to be able to look back and see how long the problem was. I guess it does just pollute the logs table though. Happy to put a check in and not log ifpostcode is None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it would be better to not log here, but to raise an error in Sentry. We still get to see when things are going wrong, but don't persist this to the logs