DemocracyClub / yournextrepresentative

👥 A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk
GNU Affero General Public License v3.0
21 stars 27 forks source link

Hotfix/ec emblem import #2343

Closed VirginiaDooley closed 4 months ago

VirginiaDooley commented 4 months ago

Peter reported that the logo hadn't updated to match the EC register: https://whocanivotefor.co.uk/parties/party:17545/party-of-women

I checked the import-parties job on WCIVF and it was running as expected.

I moved to YNR to debug and found that the emblem wasn't updating bc the id had not changed and an emblem version history did not exist. I added a way to update the emblem when only one image exists on the register.

To test this, run the local server and visit the endpoint for api/next/parties/PP17545/ Click the s3 image link and notice the old logo

run the command for the ec importer and refresh: python manage.py parties_import_from_ec

The logo should match the one shown here: https://search.electoralcommission.org.uk/English/Registrations/PP17545


VirginiaDooley commented 4 months ago

Upon further discussion with the team, the fix for this issue needs a more comprehensive rehaul. In the interim, @symroe is going to run a full import to replace all emblems.

A more comprehensive overhaul might involve checking the hash of the saved file against the remote one.

FYI, the deadline for having an emblem on the ballot is 4pm on 7 June . After that, the emblem cannot be on the ballot/used for the GE. That said, it's ok to continue importing emblem changes to our site. The scheduled job will keep running once daily, but this bug will remain until we overhaul/do manual full import.

VirginiaDooley commented 4 months ago

Ref https://github.com/DemocracyClub/yournextrepresentative/issues/2353