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:
zmoody 2018-08-02 09:55:48 -05:00
parent 5e97f87a64
commit e5eb61a85c

View File

@ -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