Skip to content

Commit

Permalink
stop storing Twitter account IDs twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Oct 29, 2018
1 parent 76d4a61 commit 6ae49a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion liberapay/elsewhere/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ class Twitter(PlatformOAuth1):
ratelimit_headers_prefix = 'x-rate-limit-'

# User info extractors
x_user_id = key('id')
x_user_id = key('id_str')
x_user_name = key('screen_name')
x_display_name = key('name')
x_email = not_available
x_avatar_url = key('profile_image_url_https',
clean=lambda v: v.replace('_normal.', '.'))
x_friends_count = key('friends_count')
x_description = key('description')
x_extra_info_drop = drop_keys('id')
2 changes: 1 addition & 1 deletion sql/branch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UPDATE elsewhere
AND json_typeof(extra_info) = 'object';

UPDATE elsewhere
SET extra_info = (extra_info::jsonb - 'entities' - 'status')::json
SET extra_info = (extra_info::jsonb - 'id_str' - 'entities' - 'status')::json
WHERE platform = 'twitter'
AND json_typeof(extra_info) = 'object';

Expand Down

0 comments on commit 6ae49a4

Please sign in to comment.