Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_user() missing 2 required positional arguments: 'name' and 'password' #217

Open
gebolisasi opened this issue Apr 1, 2020 · 5 comments

Comments

@gebolisasi
Copy link

gebolisasi commented Apr 1, 2020

I want to make social auth and get name and email from google sign in. I've been adding an extra scope

SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = ['https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'openid']

but, after trying to convert-token, i got an error

TypeError at /v1/oauth2/convert-token/
create_user() missing 2 required positional arguments: 'name' and 'password'

and this is create_user function

class UserManager(BaseUserManager):
    def create_user(self, name, email, password, **extra_fields):
        if not name:
            raise ValueError(_('The name field must be set'))
        if not email:
            raise ValueError(_('The email field must be set'))

        email = self.normalize_email(email)

        user = self.model(name=name, email=email, **extra_fields)
        user.set_password(password)
        user.save()

        return user

Is there any mistake?

@wagnerdelima
Copy link

wagnerdelima commented Jul 4, 2020

Hi all.

My team and I are constantly using this framework and it seems it has died out there. I contacted the owner by email asking if he would add some of us as maintainers so we could continue to improve it. However we didn't get a response.

I am publishing the project under my profile and we are going to continue to invest time in it.

So I would like to gently ask you to contribute to this project on: https://github.com/wagnerdelima/drf-social-oauth2

Thank you for understanding.

@hashinclude72
Copy link

set default password to None

def create_user(self, name, email, password=None, **extra_fields):

after that user.set_password(password) will set a not usable password to the field automatically

@KarimaMarina
Copy link

set default password to None

def create_user(self, name, email, password=None, **extra_fields):

after that user.set_password(password) will set a not usable password to the field automatically

I have a similar error, and I still have the same error, is there any other way to fix it ?

@wagnerdelima
Copy link

@KarimaMarina this framework is bugged. Please use https://github.com/wagnerdelima/drf-social-oauth2/ instead. If the error persists please let me know.

@kouamou29
Copy link

hi, i have this error
TypeError at /auth/user/
UserManager.create_user() takes from 2 to 4 positional arguments but 5 were given

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants