mysociety / yournextrepresentative

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

Normalize Twitter screen name case for use as dict keys #871

Closed mhl closed 8 years ago

mhl commented 8 years ago

The script was erroneously reporting that some Twitter accounts couldn't be found because keys in the screen_name_to_user_id used the canonical capitalization from Twitter, while the screen names in YNR's database might use completely different case.

This commit fixes that by making sure that when storing or looking up key / value paires in the screen_name_to_user_id dict, the key is normalized to lower-case first.