Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Support custom user model with USERNAME_FIELD != "username" #534

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dpretty
Copy link

@dpretty dpretty commented Aug 24, 2016

I'm using a custom auth model with USERNAME_FIELD = "email".

The changes here are enough, along with

USERENA_REGISTER_PROFILE = False
USERENA_REGISTER_USER = False

to get django-userena up and running with my project. However, I haven't done any thorough testing yet.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.603% when pulling 416b1b8 on LaunchlabAU:master into 2ad1826 on bread-and-pepper:master.

@swistakm
Copy link
Contributor

Thanks! This change looks very good but we won't be able to merge it until we resolve #535

@swistakm
Copy link
Contributor

#535 that was blocking this PR from merging is finally resolved. Could you rebase your PR on current master so we can have it tested in Travis again?

When doing rebase you can also squash your changes in order to keep commit log more concise.

@sdether
Copy link

sdether commented Oct 21, 2016

Should this change cover the scenario where the Custom User model does not even have a field called username? I rebased and tried this pull request and got the following error trying to create migrations with a User model with USERNAME_FIELD = 'email' and no username field at all.

SystemCheckError: System check identified some issues:

ERRORS:
<class 'userena.admin.UserenaAdmin'>: (admin.E033) The value of 'ordering[0]' refers to 'username', which is not an attribute of 'accounts.User'.
<class 'userena.admin.UserenaAdmin'>: (admin.E108) The value of 'list_display[0]' refers to 'username', which is not a callable, an attribute of 'UserenaAdmin', or an attribute or method on 'accounts.User'.

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

Successfully merging this pull request may close these issues.

4 participants