Beispiel #1
0
def create_user(strategy, details, response, uid, user=None, *args, **kwargs):
    info = social_create_user(strategy, details, response, uid, user, *args,
                              **kwargs)

    if info['is_new']:
        user = info['user']
        if settings.PYHN_NEW_USER_CAN_SUBMIT:
            permission = Permission.objects.get(codename='can_submit')
            user.user_permissions.add(permission)

        profile = Profile(user_ptr=user)
        profile.username = user.username
        profile.email = user.email
        profile.about = ''
        profile.save()

    return {'is_new': True, 'user': user}
Beispiel #2
0
def create_user(strategy, details, response, uid, user=None, *args, **kwargs):
    info = social_create_user(
        strategy, details, response, uid, user, *args, **kwargs
    )

    if info['is_new']:
        user = info['user']
        if settings.PYHN_NEW_USER_CAN_SUBMIT:
            permission = Permission.objects.get(codename='can_submit')
            user.user_permissions.add(permission)

        profile = Profile(user_ptr=user)
        profile.username = user.username
        profile.email = user.email
        profile.about = ''
        profile.save()

    return {'is_new': True, 'user': user}
Beispiel #3
0
 def save(self, user):
     profile = Profile(user_ptr=user)
     profile.username = self.cleaned_data['username']
     profile.email = self.cleaned_data['email']
     profile.about = self.cleaned_data['about']
     profile.save()
Beispiel #4
0
 def save(self, user):
     profile = Profile(user_ptr=user)
     profile.username = self.cleaned_data['username']
     profile.email = self.cleaned_data['email']
     profile.about = self.cleaned_data['about']
     profile.save()