Skip to content

Use get_user_model for reference to User #12794

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

Closed
arthanson opened this issue Jun 1, 2023 · 0 comments
Closed

Use get_user_model for reference to User #12794

arthanson opened this issue Jun 1, 2023 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Milestone

Comments

@arthanson
Copy link
Collaborator

Proposed Changes

There is a large number of places in the code that import and use the User model directly:

from django.contrib.auth.models import User

These should all be replaced with calls to get_user_model to facilitate the potential change to a custom User model.

Justification

See https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#referencing-the-user-model - this is a requirement if we are going to potentially use a custom user model.

@arthanson arthanson added the type: housekeeping Changes to the application which do not directly impact the end user label Jun 1, 2023
@arthanson arthanson added this to the v3.6 milestone Jun 1, 2023
@arthanson arthanson self-assigned this Jun 1, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Jun 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

2 participants