@ -20,3 +20,11 @@ def test_device_software_action(user):
|
||||
"""Ensure only software that is from the same organization or is global can be added to the device
|
||||
"""
|
||||
pass
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_device_not_global(user):
|
||||
"""Devices are not global items.
|
||||
|
||||
Ensure that a device can't be set to be global.
|
||||
"""
|
||||
pass
|
||||
|
@ -20,3 +20,12 @@ def test_software_update_is_global_no_change(user):
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
@pytest.mark.skip(reason="to be written")
|
||||
def test_software_prevent_delete_if_used(user):
|
||||
"""Any software in use by a device must not be deleted.
|
||||
|
||||
i.e. A device has an action set for the software.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
@ -45,7 +45,6 @@ class View(OrganizationPermission, generic.UpdateView):
|
||||
'serial_number',
|
||||
'uuid',
|
||||
'device_type',
|
||||
'is_global'
|
||||
]
|
||||
|
||||
context_object_name = "device"
|
||||
@ -110,9 +109,12 @@ class Add(PermissionRequiredMixin, OrganizationPermission, generic.CreateView):
|
||||
'uuid',
|
||||
'device_type',
|
||||
'organization',
|
||||
'is_global'
|
||||
]
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.is_global = False
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
def get_success_url(self, **kwargs):
|
||||
|
||||
|
Reference in New Issue
Block a user