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

Fix SimpleHistoryAdmin to consistently use AUTH_USER_MODEL in history #1303

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

Conversation

epou
Copy link

@epou epou commented Jan 25, 2024

Description

  • Adapt the admin user change view depending on the HistoryRecord.user_model provided (default: AUTH_USER_MODEL) on the admin history view.
  • Added ability to track custom user_model with explicit custom history_user_model

Related Issue

#1302

Motivation and Context

The SimpleHistoryAdmin.history_view assumes that the user model associated with the history_user is the one specified in AUTH_USER_MODEL, disregarding any class provided in the HistoricalRecords.user_model argument.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run the pre-commit run command to format and lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or github handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f48b53d) 96.87% compared to head (60c006d) 96.86%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1303      +/-   ##
==========================================
- Coverage   96.87%   96.86%   -0.01%     
==========================================
  Files          23       23              
  Lines        1278     1277       -1     
  Branches      211      211              
==========================================
- Hits         1238     1237       -1     
  Misses         21       21              
  Partials       19       19              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

1 participant