1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #214: Suppress status message if updated_count has not been provided

This commit is contained in:
Jeremy Stretch
2016-07-06 16:25:15 -04:00
parent 891a128736
commit 3276caa284
2 changed files with 5 additions and 5 deletions

View File

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