mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #4929: Correct log message when creating a new object
This commit is contained in:
@@ -267,9 +267,10 @@ class ObjectEditView(GetReturnURLMixin, View):
|
||||
if form.is_valid():
|
||||
logger.debug("Form validation was successful")
|
||||
|
||||
object_created = form.instance.pk is None
|
||||
obj = form.save()
|
||||
msg = '{} {}'.format(
|
||||
'Created' if not form.instance.pk else 'Modified',
|
||||
'Created' if object_created else 'Modified',
|
||||
self.model._meta.verbose_name
|
||||
)
|
||||
logger.info(f"{msg} {obj} (PK: {obj.pk})")
|
||||
|
Reference in New Issue
Block a user