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

Fixes #1022: Record user actions when creating IP addresses in bulk

This commit is contained in:
Jeremy Stretch
2017-04-03 14:45:20 -04:00
parent 6813787fc7
commit 05d3354570
2 changed files with 10 additions and 3 deletions

View File

@@ -334,7 +334,9 @@ class BulkAddView(View):
form.add_error(None, e)
if not form.errors:
messages.success(request, u"Added {} {}.".format(len(new_objs), self.model._meta.verbose_name_plural))
msg = u"Added {} {}".format(len(new_objs), self.model._meta.verbose_name_plural)
messages.success(request, msg)
UserAction.objects.log_bulk_create(request.user, ContentType.objects.get_for_model(self.model), msg)
if '_addanother' in request.POST:
return redirect(request.path)
return redirect(self.default_return_url)