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

Django 1.5 CustomUser.first_name and Admin #35

Open
lpalomo opened this issue Feb 13, 2014 · 3 comments
Open

Django 1.5 CustomUser.first_name and Admin #35

lpalomo opened this issue Feb 13, 2014 · 3 comments

Comments

@lpalomo
Copy link

lpalomo commented Feb 13, 2014

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.

@nelsongallardo
Copy link

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.

@robinlery
Copy link

Did any of you fixed this problem?

@lpalomo
Copy link
Author

lpalomo commented Mar 7, 2014

I've moved to django-friendship. A workaround would be to unregister django-relationship from the admin.

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

3 participants