mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-31 14:43:36 +02:00
17170 Add ability to add contacts to multiple contact groups (#18885)
* 17170 Allow multiple Group assignments for Contacts * 17170 update docs * 17170 update api, detail view, graphql * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fix bulk import * 17170 test fixes * 17170 test fixes * 17170 test fixes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17170 update migration * 17170 bulk edit form
This commit is contained in:
@@ -170,7 +170,7 @@ class ContactTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Contact
|
||||
brief_fields = ['description', 'display', 'id', 'name', 'url']
|
||||
bulk_update_data = {
|
||||
'group': None,
|
||||
'groups': [],
|
||||
'comments': 'New comments',
|
||||
}
|
||||
|
||||
@@ -183,20 +183,22 @@ class ContactTest(APIViewTestCases.APIViewTestCase):
|
||||
)
|
||||
|
||||
contacts = (
|
||||
Contact(name='Contact 1', group=contact_groups[0]),
|
||||
Contact(name='Contact 2', group=contact_groups[0]),
|
||||
Contact(name='Contact 3', group=contact_groups[0]),
|
||||
Contact(name='Contact 1'),
|
||||
Contact(name='Contact 2'),
|
||||
Contact(name='Contact 3'),
|
||||
)
|
||||
Contact.objects.bulk_create(contacts)
|
||||
contacts[0].groups.add(contact_groups[0])
|
||||
contacts[1].groups.add(contact_groups[0])
|
||||
contacts[2].groups.add(contact_groups[0])
|
||||
|
||||
cls.create_data = [
|
||||
{
|
||||
'name': 'Contact 4',
|
||||
'group': contact_groups[1].pk,
|
||||
'groups': [contact_groups[1].pk],
|
||||
},
|
||||
{
|
||||
'name': 'Contact 5',
|
||||
'group': contact_groups[1].pk,
|
||||
},
|
||||
{
|
||||
'name': 'Contact 6',
|
||||
|
||||
Reference in New Issue
Block a user