Support custom user model
This PR refactors the usage of the build in User model to support custom auth models
- [x] refactors all uses of User
- [x] Add migrations/refactor migrations
- [ ] Docs
- ~~[ ] unit tests to ensure custom user models work~~
Deploy Preview for inventree-web-pui-preview canceled.
| Name | Link |
|---|---|
| Latest commit | 95461799f81d7e04f62cb4aca726fc5a41a92cc5 |
| Latest deploy log | https://app.netlify.com/sites/inventree-web-pui-preview/deploys/664d272782d5860008816863 |
Does this also break related model fields in plugins that use the auth.user model?
@wolflu05 yes, that is the main "breaking" thing
This is targeted for 0.16.0 now and will be revisited once 0.15.0 is out.
I think it is already advisable for plugin deps to either target Owners or the django.cong.settings auth model - a list of best practices is on my personal roadmap for 0.16.0
Codecov Report
Attention: Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.
Project coverage is 83.43%. Comparing base (
bb93c91) to head (9546179). Report is 296 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #6418 +/- ##
==========================================
- Coverage 83.96% 83.43% -0.54%
==========================================
Files 1057 1046 -11
Lines 46498 45806 -692
Branches 1360 1192 -168
==========================================
- Hits 39043 38217 -826
- Misses 7102 7335 +233
+ Partials 353 254 -99
| Flag | Coverage Ξ | |
|---|---|---|
| backend | 85.42% <91.17%> (ΓΈ) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@matmair LGTM
- Any documentation needed around this?
- What happens to the migrations if a custom user model is actually used? Do we need to edit existing migrations?
Needs docs
- What happens to the migrations if a custom user model is actually used? Do we need to edit existing migrations?
I have tested that it works but I will try to add a CI test for that too
@matmair do you want to target 0.16.x or bump to 0.17.x?
@SchrodingersGat let's move this, I am focusing on getting user custom states in for 0.16.x
Closing this in favour of an upcoming PR that adds a custom user model