mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
17170 fixes
This commit is contained in:
parent
8c62465b81
commit
a843765d0c
@ -5,7 +5,7 @@ from netbox.forms import NetBoxModelBulkEditForm
|
||||
from tenancy.choices import ContactPriorityChoices
|
||||
from tenancy.models import *
|
||||
from utilities.forms import add_blank_choice
|
||||
from utilities.forms.fields import CommentField, DynamicModelChoiceField
|
||||
from utilities.forms.fields import CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField
|
||||
from utilities.forms.rendering import FieldSet
|
||||
|
||||
__all__ = (
|
||||
@ -90,8 +90,8 @@ class ContactRoleBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
||||
|
||||
class ContactBulkEditForm(NetBoxModelBulkEditForm):
|
||||
group = DynamicModelChoiceField(
|
||||
label=_('Group'),
|
||||
groups = DynamicModelMultipleChoiceField(
|
||||
label=_('Groups'),
|
||||
queryset=ContactGroup.objects.all(),
|
||||
required=False
|
||||
)
|
||||
@ -127,9 +127,9 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
||||
model = Contact
|
||||
fieldsets = (
|
||||
FieldSet('group', 'title', 'phone', 'email', 'address', 'link', 'description'),
|
||||
FieldSet('groups', 'title', 'phone', 'email', 'address', 'link', 'description'),
|
||||
)
|
||||
nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'link', 'description', 'comments')
|
||||
nullable_fields = ('groups', 'title', 'phone', 'email', 'address', 'link', 'description', 'comments')
|
||||
|
||||
|
||||
class ContactAssignmentBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
@ -208,13 +208,13 @@ class ContactTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
|
||||
cls.form_data = {
|
||||
'name': 'Contact X',
|
||||
'group': contact_groups[1].pk,
|
||||
'groups': [contact_groups[1].pk],
|
||||
'comments': 'Some comments',
|
||||
'tags': [t.pk for t in tags],
|
||||
}
|
||||
|
||||
cls.csv_data = (
|
||||
"group,name",
|
||||
"groups,name",
|
||||
"Contact Group 1,Contact 4",
|
||||
"Contact Group 1,Contact 5",
|
||||
"Contact Group 1,Contact 6",
|
||||
@ -228,7 +228,7 @@ class ContactTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
)
|
||||
|
||||
cls.bulk_edit_data = {
|
||||
'group': contact_groups[1].pk,
|
||||
'description': "New description",
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user