Skip to content

17170 Add ability to add contacts to multiple contact groups #18885

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

Merged
merged 22 commits into from
Mar 18, 2025

Conversation

arthanson
Copy link
Collaborator

@arthanson arthanson commented Mar 12, 2025

Fixes: #17170

Changed Contacts Group field to be M2M field so a contact can belong to multiple contact groups. There were some issues as ContactGroup is a nested model (so using TreeNode) which I don't think we have done before (allowing multiple assignments of a TreeNode field).

This caused an issue in utilities.testing.fitersets.py as it was expecting ModelMultipleChoiceField instead of TreeNodeModelMultipleChoiceField (which is derived from ModelMultipleChoiceField) so changed the assert to assertIsInstance: https://github.com/netbox-community/netbox/pull/18885/files#diff-27b47272104ca5b929872465d014bb392aacf97b3fc957695d85ebaa82171e40

Changed group references to groups as it is plural now.

ContactFilterSet was throwing a missing filter error when using group_id, group, needed to change it to contact_group_id, contact_group. Not completely sure why that was complaining with the change.

@arthanson arthanson marked this pull request as ready for review March 13, 2025 20:34
@arthanson arthanson requested review from a team and jeremystretch and removed request for a team March 13, 2025 20:35
@arthanson arthanson changed the title DRAFT: 17170 contact groups 17170 Add ability to add contacts to multiple contact groups Mar 13, 2025
@jeremystretch jeremystretch added this to the v4.3 milestone Mar 14, 2025
@arthanson arthanson requested a review from jeremystretch March 17, 2025 21:10
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few minor cleanup items, but other than those this looks good to go!

@arthanson arthanson requested a review from jeremystretch March 18, 2025 17:21
@jeremystretch jeremystretch merged commit af5ec19 into feature Mar 18, 2025
6 checks passed
@jeremystretch jeremystretch deleted the 17170-contact-groups branch March 18, 2025 18:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants