You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears to be that you are using the field first_name for displaying the relationships on the admin but there is no guarranty that a CustomUser would have this field. I think the only field that would be there for sure is USERNAME_FIELD [get_username()]. I'm pretty new with Django so please correct me if I'm wrong.
The text was updated successfully, but these errors were encountered:
Similar problem, I have a custom user model and I get this error:
'username' is not a callable or an attribute of 'UserRelationshipAdmin' or found in the model 'MyCustomUser'.
Evidently I don't have a 'username' field in my custom user model, I have an email defined as USERNAME_FIELD in the model instead
EDIT: I think the problem is in admin.py when importing
from django.contrib.auth.admin import UserAdmin
The UserAdmin is using the fields for the built-in User model, and when registering: admin.site.register(User, UserRelationshipAdmin) we have the error, instead of importing UserAdmin we should be able to import the custom user admin, I'm also pretty new to django so I couldn't find a solution yet.
It appears to be that you are using the field first_name for displaying the relationships on the admin but there is no guarranty that a CustomUser would have this field. I think the only field that would be there for sure is USERNAME_FIELD [get_username()]. I'm pretty new with Django so please correct me if I'm wrong.
The text was updated successfully, but these errors were encountered: