From 289a762bf18b87f7cb5b1de6a8d1e5179a134dc6 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 10 Jul 2018 10:10:22 -0400 Subject: [PATCH] Record tags when serializing an object for an ObjectChange --- netbox/utilities/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 318b04dad..45fbf1c7c 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -100,6 +100,10 @@ def serialize_object(obj, extra=None): field.name: value for field, value in obj.get_custom_fields().items() } + # Include any tags + if hasattr(obj, 'tags'): + data['tags'] = [tag.name for tag in obj.tags.all()] + # Append any extra data if extra is not None: data.update(extra)