예제 #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}
예제 #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}
예제 #3
0
파일: forms.py 프로젝트: akun/PyHackerNews
 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()
예제 #4
0
파일: forms.py 프로젝트: q1f3/PyHackerNews
 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()