#there’s an issue related to the custom user model

12 messages · Page 1 of 1 (latest)

lone spade
#

The error message i am encountering, “Manager isn’t available; ‘auth.User’ has been swapped for ‘account.User’”,

i have created custom user model for account/models.py

when i go and submit signup form which i have created then the above mentioned error is shown to me.

https://github.com/pushkarcodes110/project_management/tree/main/account

project is uploaded latest as a repo, please do check the codes and revert back to me if you fins any potential errors... i have literally spent days on this thing and its frustrating now. Thanks

GitHub

Contribute to pushkarcodes110/project_management development by creating an account on GitHub.

shut onyx
#

I see you have both from django.contrib.auth.models import User and from .models import User

lone spade
#

i am heading back to this error :

#

Manager isn't available; 'auth.User' has been swapped for 'account.User'

#

and it specifically says error in this line of code :
user = User.objects.create_user(username=name, email=email, password=password1)

ruby delta
#

If you're using your own User, don't import it from django.contrib.auth.models 🙃

lone spade
#

i read the article but i am unable to implement this, sorrry 😦

lone spade
#

yo, finally got the outcome as expected. got a help from chatgpt modifying the code with get_user_model()....

#

Thank you @ruby delta

ruby delta
#

Glad you got there. I hope you fully understand what ChatGPT gave you; there is nothing worse than AI-generated code in your codebase that you don’t know why it works