[PR #17049] [MERGED] Closes #17048: Replace all calls to get_user_model() with direct imports of User #14986

Closed
opened 2025-12-30 00:19:18 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17049
Author: @jeremystretch
Created: 7/31/2024
Status: Merged
Merged: 8/1/2024
Merged by: @jeremystretch

Base: featureHead: 17048-remove-get_user_model


📝 Commits (1)

  • 9060c94 Closes #17048: Replace all calls to get_user_model() with direct imports of User

📊 Changes

37 files changed (+79 additions, -132 deletions)

View changed files

📝 netbox/core/filtersets.py (+3 -3)
📝 netbox/core/forms/filtersets.py (+3 -3)
📝 netbox/core/management/commands/nbshell.py (+2 -2)
📝 netbox/dcim/filtersets.py (+3 -3)
📝 netbox/dcim/forms/bulk_edit.py (+2 -4)
📝 netbox/dcim/forms/filtersets.py (+2 -2)
📝 netbox/dcim/forms/model_forms.py (+2 -4)
📝 netbox/dcim/tests/test_api.py (+1 -4)
📝 netbox/dcim/tests/test_filtersets.py (+1 -3)
📝 netbox/dcim/tests/test_views.py (+1 -3)
📝 netbox/extras/api/serializers_/journaling.py (+2 -2)
📝 netbox/extras/events.py (+2 -3)
📝 netbox/extras/filtersets.py (+6 -7)
📝 netbox/extras/forms/filtersets.py (+3 -4)
📝 netbox/extras/management/commands/runscript.py (+1 -4)
📝 netbox/extras/models/dashboard.py (+1 -2)
📝 netbox/extras/models/staging.py (+1 -2)
📝 netbox/netbox/authentication/__init__.py (+5 -8)
📝 netbox/netbox/tests/test_authentication.py (+1 -5)
📝 netbox/users/api/nested_serializers.py (+3 -4)

...and 17 more files

📄 Description

Closes: #17048

  • Replace calls to get_user_model() with the User class
  • Replace foreign key references to User with the string users.User

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17049 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 7/31/2024 **Status:** ✅ Merged **Merged:** 8/1/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `17048-remove-get_user_model` --- ### 📝 Commits (1) - [`9060c94`](https://github.com/netbox-community/netbox/commit/9060c94ede5519179211ef2ff9c0f6ed345f8e29) Closes #17048: Replace all calls to get_user_model() with direct imports of User ### 📊 Changes **37 files changed** (+79 additions, -132 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/filtersets.py` (+3 -3) 📝 `netbox/core/forms/filtersets.py` (+3 -3) 📝 `netbox/core/management/commands/nbshell.py` (+2 -2) 📝 `netbox/dcim/filtersets.py` (+3 -3) 📝 `netbox/dcim/forms/bulk_edit.py` (+2 -4) 📝 `netbox/dcim/forms/filtersets.py` (+2 -2) 📝 `netbox/dcim/forms/model_forms.py` (+2 -4) 📝 `netbox/dcim/tests/test_api.py` (+1 -4) 📝 `netbox/dcim/tests/test_filtersets.py` (+1 -3) 📝 `netbox/dcim/tests/test_views.py` (+1 -3) 📝 `netbox/extras/api/serializers_/journaling.py` (+2 -2) 📝 `netbox/extras/events.py` (+2 -3) 📝 `netbox/extras/filtersets.py` (+6 -7) 📝 `netbox/extras/forms/filtersets.py` (+3 -4) 📝 `netbox/extras/management/commands/runscript.py` (+1 -4) 📝 `netbox/extras/models/dashboard.py` (+1 -2) 📝 `netbox/extras/models/staging.py` (+1 -2) 📝 `netbox/netbox/authentication/__init__.py` (+5 -8) 📝 `netbox/netbox/tests/test_authentication.py` (+1 -5) 📝 `netbox/users/api/nested_serializers.py` (+3 -4) _...and 17 more files_ </details> ### 📄 Description ### Closes: #17048 - Replace calls to `get_user_model()` with the `User` class - Replace foreign key references to User with the string `users.User` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:19:18 +01:00
adam closed this issue 2025-12-30 00:19:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14986