diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index ea7d6f4a83..260eb57f91 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,15 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 572 +INVENTREE_API_VERSION = 573 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v573 -> 2026-11-07 : https://github.com/inventree/InvenTree/pull/13221 + - Mark audit log changes_detail field as nullable + - Add warning field to ApiToken + v572 -> 2026-11-07 : https://github.com/inventree/InvenTree/pull/13212 - Username and email fields on the /api/user/me endpoint are now read-only diff --git a/src/backend/InvenTree/audit/serializers.py b/src/backend/InvenTree/audit/serializers.py index 6e41f62c2f..c2efeca667 100644 --- a/src/backend/InvenTree/audit/serializers.py +++ b/src/backend/InvenTree/audit/serializers.py @@ -159,7 +159,11 @@ class AuditLogEntrySerializer( changes_detail = OptionalField( serializer_class=serializers.SerializerMethodField, - serializer_kwargs={'read_only': True, 'label': _('Change Details')}, + serializer_kwargs={ + 'read_only': True, + 'allow_null': True, + 'label': _('Change Details'), + }, default_include=False, ) diff --git a/src/backend/InvenTree/users/serializers.py b/src/backend/InvenTree/users/serializers.py index b03af9a106..0efa5af89a 100644 --- a/src/backend/InvenTree/users/serializers.py +++ b/src/backend/InvenTree/users/serializers.py @@ -266,6 +266,7 @@ class ApiTokenSerializer(InvenTreeModelSerializer): 'issued_by_detail', 'token_version', 'revocation_reason', + 'warning', ] read_only_fields = [ 'last_seen', @@ -274,6 +275,7 @@ class ApiTokenSerializer(InvenTreeModelSerializer): 'issued_by', 'token_version', 'revocation_reason', + 'warning', ] def validate_expiry(self, expiry): @@ -314,6 +316,7 @@ class ApiTokenSerializer(InvenTreeModelSerializer): issued_by_detail = UserSerializer( source='issued_by', read_only=True, allow_null=True ) + warning = serializers.CharField(read_only=True, allow_null=True) class GroupSerializer(FilterableSerializerMixin, InvenTreeModelSerializer):