danfairs/django-lazysignup — Issue #16: Making is_lazy_user return false if registered with django-allauth
Author: madteckhead
Created: 2012-02-08 08:58:40+00:00
State: open

I'm trying to integrate django-lazysignup, and django-allauth. I've modified the convert page to linking to a social account. Once this is done I want is_lazy_user to return False as login should happen via allauth now. I've had a look at the template tag code and it checks user.backend, which I'm setting to '' in the allauth login routine. Specifically I modified complete_social_login() in allauth/socialaccount/helpers.py to include the following at Line 107

# New social account
account.user = request.user
account.sync(data)
messages.add_message \
(request, messages.INFO,
_('The social account has been connected to your existing account'))
try:
#TODO check if the values exist first
#account.user.username = generate_unique_username(data.get('username', email or 'user'))
#account.user.username = "testmanualsetting"
account.user.last_name = data.get('last_name', '')[0:User._meta.get_field('last_name').max_length]
account.user.first_name = data.get('first_name', '')[0:User._meta.get_field('first_name').max_length]
account.user.lazyuser_set.all().delete()
account.user.backend = ''
account.user.save()
except:
pass

Also I noted that it falls back on database entries, so I've removed those too. After this is_lazy_user is still returning True. Is this something to do with me updating user.backend on the wrong instance?

I know this isn't really an 'Issue' with lazysignup but wasn't sure where to post for advice.

Thanks in advance,

Nathan