[BUG] Order of states in schema descriptions is not stable (#7978)

Fixes #7977
This commit is contained in:
Matthias Mair 2024-08-24 00:28:58 +02:00 committed by GitHub
parent b9b44126de
commit 8f4929d754
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -1,12 +1,16 @@
"""InvenTree API version information."""
# InvenTree API version
INVENTREE_API_VERSION = 248
INVENTREE_API_VERSION = 249
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
INVENTREE_API_TEXT = """
v249 - 2024-08-23 : https://github.com/inventree/InvenTree/pull/7978
- Sort status enums
v248 - 2024-08-23 : https://github.com/inventree/InvenTree/pull/7965
- Small adjustments to labels for new custom status fields

View File

@ -33,7 +33,8 @@ def state_color_mappings():
def state_reference_mappings():
"""Return a list of custom user state references."""
return [(a.__name__, a.__name__) for a in get_custom_classes(include_custom=False)]
classes = get_custom_classes(include_custom=False)
return [(a.__name__, a.__name__) for a in sorted(classes, key=lambda x: x.__name__)]
def get_logical_value(value, model: str):