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

Cannot install with custom User model #3

Open
ishankhare07 opened this issue Aug 30, 2020 · 1 comment
Open

Cannot install with custom User model #3

ishankhare07 opened this issue Aug 30, 2020 · 1 comment

Comments

@ishankhare07
Copy link

Hi, I have a custom user model defined. For this reason I already have settings.AUTH_USER_MODEL set.
But going through the installation docs, when I run manage.py migrate I get the following error:

ERRORS:
diary.Customer.user_ptr: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
        HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.
diary.Entry.creator: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
        HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.
diary.Entry.editor: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
        HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.

Currently I've already set settings.AUTH_USER_MODEL='core.User'

@BobBowles
Copy link
Owner

I need more details about how you have set up your user customisation before I can usefully comment very much on this.

However, what I can say is that django-diary uses a Customer model that subclasses the default User. If you are using a different User model in your app that is likely to cause complications in several places. The first such place is in the migrations. Secondly, you are likely to need to create and install your own authentication backend in such a way that django-diary works harmoniously with your own code.

If you look at the setup of the example test app it is designed in such a way that Users typically have admin rights, while Customers have much more restricted access, and in particular cannot see or modify each others' details.

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

2 participants