coldfront icon indicating copy to clipboard operation
coldfront copied to clipboard

Replace explicit User references with get_user_model and settings.AUTH_USER_MODEL

Open aaronk opened this issue 4 years ago • 3 comments

We're currently using a custom Django user model for some libraries that we use with our billing system. It would be valuable to use the custom model in place of the standard Django User.

I can generate a PR with the necessary changes.

aaronk avatar Apr 06 '21 21:04 aaronk

@aaronk Thanks for the feedback. We'll have to investigate this a bit more as it appears this can be difficult to change. See here.

aebruno avatar Apr 13 '21 13:04 aebruno

It can definitely be difficult to change to a new user model mid-project. However, as we are starting fresh, all I'll need to do is add our library early in the Django APPS list and we'll be good to go. It shouldn't affect your existing customers since django.contrib.auth.models.User is the default.

aaronk avatar Apr 13 '21 14:04 aaronk

@aebruno I agree with @aaronk it would be beneficial to make the user model pluggable and hence help one starting fresh. Changing the current UserProfile model to add site specific attributes requires keeping up with future upgrades of the core app. I wonder how other sites are extending it, if they are?

ahkumar avatar Jan 08 '24 19:01 ahkumar