From e5eb61a85ce11d05a40853ae0e98128acfd258c4 Mon Sep 17 00:00:00 2001 From: zmoody Date: Thu, 2 Aug 2018 09:55:48 -0500 Subject: [PATCH] Fixes #2294 - 500 From API when PUT with Empty Tags Checks that obj.tags isn't empty before trying to call .all() --- netbox/utilities/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 14c29d211..3f018849d 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -101,7 +101,7 @@ def serialize_object(obj, extra=None): } # Include any tags - if hasattr(obj, 'tags'): + if hasattr(obj, 'tags') and obj.tags: data['tags'] = [tag.name for tag in obj.tags.all()] # Append any extra data