Skip to content

Use get_user_model for reference to User  #12794

@arthanson

Description

@arthanson

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.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions