Skip to content

Commit

Permalink
If a user is logged in, checking in via twitter will now associate th…
Browse files Browse the repository at this point in the history
…eir twitter account with their user profile
  • Loading branch information
devioustree committed Feb 17, 2010
1 parent 94db7fb commit f0bb13a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions socialregistration/views.py
Expand Up @@ -178,12 +178,15 @@ def twitter(request, account_inactive_template='socialregistration/account_inact
)

user_info = client.get_user_info()

if request.user.is_authenticated():
profile, created = TwitterProfile.objects.get_or_create(user=request.user, twitter_id=user_info['id'])
return HttpResponseRedirect(_get_next(request))

user = authenticate(twitter_id=user_info['id'])

if user is None:
profile = TwitterProfile(twitter_id=user_info['id'],
)
profile = TwitterProfile(twitter_id=user_info['id'])
user = User()
request.session['socialregistration_profile'] = profile
request.session['socialregistration_user'] = user
Expand Down

0 comments on commit f0bb13a

Please sign in to comment.