mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 19:36:26 -06:00
17178 review changes
This commit is contained in:
parent
78e0a5af3f
commit
5a5a7f3213
@ -195,6 +195,7 @@ class ContactTest(APIViewTestCases.APIViewTestCase):
|
|||||||
cls.create_data = [
|
cls.create_data = [
|
||||||
{
|
{
|
||||||
'name': 'Contact 4',
|
'name': 'Contact 4',
|
||||||
|
'groups': [contact_groups[1].pk],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'Contact 5',
|
'name': 'Contact 5',
|
||||||
|
@ -215,16 +215,17 @@ class ContactTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
|
|
||||||
cls.csv_data = (
|
cls.csv_data = (
|
||||||
"name",
|
"name",
|
||||||
|
"groups",
|
||||||
"Contact 4",
|
"Contact 4",
|
||||||
"Contact 5",
|
"Contact 5",
|
||||||
"Contact 6",
|
"Contact 6",
|
||||||
)
|
)
|
||||||
|
|
||||||
cls.csv_update_data = (
|
cls.csv_update_data = (
|
||||||
"id,name,comments",
|
"id,name,groups,comments",
|
||||||
f"{contacts[0].pk},Contact Group 7,New comments 7",
|
f'{contacts[0].pk},Contact 7,"Contact Group 1,Contact Group 2",New comments 7',
|
||||||
f"{contacts[1].pk},Contact Group 8,New comments 8",
|
f'{contacts[1].pk},Contact 8,"Contact Group 1",New comments 8',
|
||||||
f"{contacts[2].pk},Contact Group 9,New comments 9",
|
f'{contacts[2].pk},Contact 9,"Contact Group 1",New comments 9',
|
||||||
)
|
)
|
||||||
|
|
||||||
cls.bulk_edit_data = {
|
cls.bulk_edit_data = {
|
||||||
|
@ -183,14 +183,12 @@ class ContactGroupListView(generic.ObjectListView):
|
|||||||
class ContactGroupView(GetRelatedModelsMixin, generic.ObjectView):
|
class ContactGroupView(GetRelatedModelsMixin, generic.ObjectView):
|
||||||
queryset = ContactGroup.objects.all()
|
queryset = ContactGroup.objects.all()
|
||||||
|
|
||||||
"""
|
|
||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
groups = instance.get_descendants(include_self=True)
|
groups = instance.get_descendants(include_self=True)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'related_models': self.get_related_models(request, groups),
|
'related_models': self.get_related_models(request, groups),
|
||||||
}
|
}
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
@register_model_view(ContactGroup, 'add', detail=False)
|
@register_model_view(ContactGroup, 'add', detail=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user