Fixes #9891: Ensure consistent ordering for tags during object serialization

This commit is contained in:
jeremystretch 2022-08-01 09:32:52 -04:00
parent 84f2225f42
commit 9fe5f09742
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,10 @@
* [#9762](https://github.com/netbox-community/netbox/issues/9762) - Add `nat_outside` column to the IPAddress table
* [#9825](https://github.com/netbox-community/netbox/issues/9825) - Add contacts column to virtual machines table
### Bug Fixes
* [#9891](https://github.com/netbox-community/netbox/issues/9891) - Ensure consistent ordering for tags during object serialization
---
## v3.2.7 (2022-07-20)

View File

@ -148,7 +148,7 @@ def serialize_object(obj, extra=None):
# Include any tags. Check for tags cached on the instance; fall back to using the manager.
if is_taggable(obj):
tags = getattr(obj, '_tags', None) or obj.tags.all()
data['tags'] = [tag.name for tag in tags]
data['tags'] = sorted([tag.name for tag in tags])
# Append any extra data
if extra is not None: