mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #214: Suppress status message if updated_count has not been provided
This commit is contained in:
parent
891a128736
commit
3276caa284
@ -1340,7 +1340,7 @@ class InterfaceBulkAddView(PermissionRequiredMixin, BulkEditView):
|
||||
iface_form = forms.InterfaceForm({
|
||||
'device': device.pk,
|
||||
'name': name,
|
||||
'mac_address': mac_address,
|
||||
'mac_address': form.cleaned_data['mac_address'],
|
||||
'form_factor': form.cleaned_data['form_factor'],
|
||||
'mgmt_only': form.cleaned_data['mgmt_only'],
|
||||
'description': form.cleaned_data['description'],
|
||||
|
@ -280,10 +280,10 @@ class BulkEditView(View):
|
||||
form = self.form(request.POST)
|
||||
if form.is_valid():
|
||||
updated_count = self.update_objects(pk_list, form)
|
||||
msg = 'Updated {} {}'.format(updated_count, self.cls._meta.verbose_name_plural)
|
||||
messages.success(self.request, msg)
|
||||
UserAction.objects.log_bulk_edit(request.user, ContentType.objects.get_for_model(self.cls), msg)
|
||||
|
||||
if updated_count:
|
||||
msg = 'Updated {} {}'.format(updated_count, self.cls._meta.verbose_name_plural)
|
||||
messages.success(self.request, msg)
|
||||
UserAction.objects.log_bulk_edit(request.user, ContentType.objects.get_for_model(self.cls), msg)
|
||||
return redirect(redirect_url)
|
||||
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user