4 ms·
How is your design affected? For the case when the user isn't willing to give access to his/her twitter account. The error returned is KeyError, since you are
by mmq 14y ago
How is your design affected?
For the case when the user isn't willing to give access to his/her twitter account.
The error returned is KeyError, since you are trying to access :
user = User.objects.get(username = authorized_tokens['screen_name'])
I see that you have put a try, except blocks. But you are not catching the KeyError exception. You are only making an exception when the user doesn't exist.
you should add a block : except KeyError. And figure out the logic for this particular case. (probably just redirecting the user to the home page)