[PR #15304] [MERGED] #12795: Introduce a custom Group model #14570

Closed
opened 2025-12-29 23:25:15 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/15304
Author: @jeremystretch
Created: 2/28/2024
Status: Merged
Merged: 3/4/2024
Merged by: @jeremystretch

Base: featureHead: 12795-custom-group-model


📝 Commits (6)

  • bc2b1e0 Rename sequences & indexes after renaming users table
  • 9f64e7d Migrate from auth.Group to a custom group model
  • 4031901 Delete original groups from auth_group table
  • cb61ed3 Update object & multi-object custom fields referencing the Group model
  • 3d24239 Fix ContentType resolution
  • f53a3aa Clean up obsolete logic for view/serializer resolution

📊 Changes

26 files changed (+207 additions, -118 deletions)

View changed files

📝 netbox/netbox/authentication.py (+2 -2)
📝 netbox/netbox/navigation/menu.py (+3 -3)
📝 netbox/netbox/tests/test_authentication.py (+1 -2)
📝 netbox/templates/users/group.html (+1 -1)
📝 netbox/templates/users/objectpermission.html (+1 -1)
📝 netbox/templates/users/user.html (+1 -1)
📝 netbox/users/api/nested_serializers.py (+1 -2)
📝 netbox/users/api/serializers.py (+1 -2)
📝 netbox/users/api/views.py (+4 -6)
📝 netbox/users/filtersets.py (+1 -2)
📝 netbox/users/forms/bulk_import.py (+1 -1)
📝 netbox/users/forms/filtersets.py (+2 -3)
📝 netbox/users/forms/model_forms.py (+3 -4)
📝 netbox/users/graphql/schema.py (+3 -3)
📝 netbox/users/graphql/types.py (+1 -1)
📝 netbox/users/migrations/0005_alter_user_table.py (+16 -4)
netbox/users/migrations/0006_custom_group_model.py (+80 -0)
📝 netbox/users/models.py (+56 -28)
📝 netbox/users/tables.py (+4 -4)
📝 netbox/users/tests/test_api.py (+1 -2)

...and 6 more files

📄 Description

Closes: #12795

This continues the work started under PR #15005, which introduced a custom User model.

  • Introduce a new Group model in the users app
  • Replicate all group records from the stock model (contrib.auth.models.Group)
  • Update many-to-many fields on the User and ObjectPermission models
  • Delete the NetBoxGroup proxy model & update all references to it

🔄 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/15304 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/28/2024 **Status:** ✅ Merged **Merged:** 3/4/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `12795-custom-group-model` --- ### 📝 Commits (6) - [`bc2b1e0`](https://github.com/netbox-community/netbox/commit/bc2b1e0709ea4d4115a78d46c9d318c87dd01ace) Rename sequences & indexes after renaming users table - [`9f64e7d`](https://github.com/netbox-community/netbox/commit/9f64e7d88f312bf52fb64d6384e3ed5fe4780ec9) Migrate from auth.Group to a custom group model - [`4031901`](https://github.com/netbox-community/netbox/commit/4031901669c4fda7876612508732f3be510b9db0) Delete original groups from auth_group table - [`cb61ed3`](https://github.com/netbox-community/netbox/commit/cb61ed327730ae4c1d260c9cc0f443aed0e88f04) Update object & multi-object custom fields referencing the Group model - [`3d24239`](https://github.com/netbox-community/netbox/commit/3d24239b68f9025553da32955715526916827c54) Fix ContentType resolution - [`f53a3aa`](https://github.com/netbox-community/netbox/commit/f53a3aa42bdb7b0dd0c41ba3cf4e73af058ec8d9) Clean up obsolete logic for view/serializer resolution ### 📊 Changes **26 files changed** (+207 additions, -118 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/authentication.py` (+2 -2) 📝 `netbox/netbox/navigation/menu.py` (+3 -3) 📝 `netbox/netbox/tests/test_authentication.py` (+1 -2) 📝 `netbox/templates/users/group.html` (+1 -1) 📝 `netbox/templates/users/objectpermission.html` (+1 -1) 📝 `netbox/templates/users/user.html` (+1 -1) 📝 `netbox/users/api/nested_serializers.py` (+1 -2) 📝 `netbox/users/api/serializers.py` (+1 -2) 📝 `netbox/users/api/views.py` (+4 -6) 📝 `netbox/users/filtersets.py` (+1 -2) 📝 `netbox/users/forms/bulk_import.py` (+1 -1) 📝 `netbox/users/forms/filtersets.py` (+2 -3) 📝 `netbox/users/forms/model_forms.py` (+3 -4) 📝 `netbox/users/graphql/schema.py` (+3 -3) 📝 `netbox/users/graphql/types.py` (+1 -1) 📝 `netbox/users/migrations/0005_alter_user_table.py` (+16 -4) ➕ `netbox/users/migrations/0006_custom_group_model.py` (+80 -0) 📝 `netbox/users/models.py` (+56 -28) 📝 `netbox/users/tables.py` (+4 -4) 📝 `netbox/users/tests/test_api.py` (+1 -2) _...and 6 more files_ </details> ### 📄 Description ### Closes: #12795 This continues the work started under PR #15005, which introduced a custom User model. - Introduce a new Group model in the `users` app - Replicate all group records from the stock model (`contrib.auth.models.Group`) - Update many-to-many fields on the User and ObjectPermission models - Delete the NetBoxGroup proxy model & update all references to it --- <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-29 23:25:15 +01:00
adam closed this issue 2025-12-29 23:25:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14570