ykdojo / editdojo

(I'm no longer working on this - currently working on https://github.com/ykdojo/defaang)
https://www.csdojo.io/edit
MIT License
332 stars 98 forks source link

When following a user on Twitter, use their ID instead of their handle #37

Closed ykdojo closed 5 years ago

ykdojo commented 5 years ago

We need to do this just in case the user changes their user handle on Twitter.

ykdojo commented 5 years ago

I'm going to work on this now.

ykdojo commented 5 years ago

NOTES: in my Django console, I did the following.

from users.models import CustomUser from allauth.socialaccount.models import SocialAccount

u = CustomUser.objects.filter(username = 'ykdojo')[0] sa = SocialAccount.objects.filter(user = u)[0] sa.uid # this gives me my Twitter ID, I think. I should be able to use this ID to follow this account instead of using the Twitter handle, which the user might change anytime.

ykdojo commented 5 years ago

done: https://github.com/ykdojo/editdojo/commit/2f58d0dda796f1427c7cea89975881e7360fbd73