mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
Fixes #2294 - 500 From API when PUT with Empty Tags
Checks that obj.tags isn't empty before trying to call .all()
This commit is contained in:
parent
5e97f87a64
commit
e5eb61a85c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user