Fixed platform selection during bulk editing of devices

This commit is contained in:
Jeremy Stretch
2016-07-27 16:38:21 -04:00
parent 76efea87ff
commit 1f9e4dc707
2 changed files with 14 additions and 5 deletions

View File

@@ -626,10 +626,10 @@ class DeviceBulkEditView(PermissionRequiredMixin, BulkEditView):
def update_objects(self, pk_list, form):
fields_to_update = {}
if form.cleaned_data['platform']:
fields_to_update['platform'] = form.cleaned_data['platform']
elif form.cleaned_data['platform_delete']:
if form.cleaned_data['platform'] == 0:
fields_to_update['platform'] = None
elif form.cleaned_data['platform']:
fields_to_update['platform'] = form.cleaned_data['platform']
if form.cleaned_data['status']:
status = form.cleaned_data['status']
fields_to_update['status'] = True if status == 'True' else False