feat(device): Prevent devices from being set global

!5
This commit is contained in:
2024-05-17 22:20:30 +09:30
parent 0e69a0accc
commit aade1e80d7
3 changed files with 21 additions and 2 deletions

View File

@ -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):