mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-10 10:57:52 +00:00
Token and Audit Log missing API annotations (#13221)
* Document existing token warning field in schema * Unrequire audit log entry changes_detail * Update api version
This commit is contained in:
1 parent
f2199caf91
commit
4ba5cfbb67
3 files changed
+13
-2
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user