mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-14 22:20:59 +00:00
Add missing schema nullable tags (#12986)
* Synchronize detail field nullable state with model user fields * Make me-user roles field nullable/non-required * Make client-secret nullable * Update api version --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
1 parent
3e367df724
commit
cbcb81f3d7
3 files changed
+12
-4
No files matched your search
@@ -1,11 +1,14 @@
|
|||||||
"""InvenTree API version information."""
|
"""InvenTree API version information."""
|
||||||
|
|
||||||
# InvenTree API version
|
# InvenTree API version
|
||||||
INVENTREE_API_VERSION = 553
|
INVENTREE_API_VERSION = 554
|
||||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||||
|
|
||||||
INVENTREE_API_TEXT = """
|
INVENTREE_API_TEXT = """
|
||||||
|
|
||||||
|
v554 -> 2026-10-09 : https://github.com/inventree/InvenTree/pull/12986
|
||||||
|
- Add missing nullable annotations for read_only fields
|
||||||
|
|
||||||
v553 -> 2026-10-04 : https://github.com/inventree/InvenTree/pull/12965
|
v553 -> 2026-10-04 : https://github.com/inventree/InvenTree/pull/12965
|
||||||
- Fix user creation with 'group_ids' via the User API endpoint
|
- Fix user creation with 'group_ids' via the User API endpoint
|
||||||
|
|
||||||
|
|||||||
@@ -1323,6 +1323,7 @@ class OAuth2ApplicationSerializer(serializers.ModelSerializer):
|
|||||||
'is_builtin',
|
'is_builtin',
|
||||||
]
|
]
|
||||||
read_only_fields = ['id', 'client_id', 'client_secret', 'is_builtin']
|
read_only_fields = ['id', 'client_id', 'client_secret', 'is_builtin']
|
||||||
|
extra_kwargs = {'client_secret': {'allow_null': True}}
|
||||||
|
|
||||||
is_builtin = serializers.SerializerMethodField()
|
is_builtin = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
|||||||
@@ -268,8 +268,12 @@ class ApiTokenSerializer(InvenTreeModelSerializer):
|
|||||||
return super().validate(data)
|
return super().validate(data)
|
||||||
|
|
||||||
user_detail = UserSerializer(source='user', read_only=True)
|
user_detail = UserSerializer(source='user', read_only=True)
|
||||||
revoked_by_detail = UserSerializer(source='revoked_by', read_only=True)
|
revoked_by_detail = UserSerializer(
|
||||||
issued_by_detail = UserSerializer(source='issued_by', read_only=True)
|
source='revoked_by', read_only=True, allow_null=True
|
||||||
|
)
|
||||||
|
issued_by_detail = UserSerializer(
|
||||||
|
source='issued_by', read_only=True, allow_null=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class GroupSerializer(FilterableSerializerMixin, InvenTreeModelSerializer):
|
class GroupSerializer(FilterableSerializerMixin, InvenTreeModelSerializer):
|
||||||
@@ -444,7 +448,7 @@ class MeUserSerializer(FilterableSerializerMixin, ExtendedUserSerializer):
|
|||||||
# they were previously served as a single '/user/me/roles/' response.
|
# they were previously served as a single '/user/me/roles/' response.
|
||||||
roles = OptionalField(
|
roles = OptionalField(
|
||||||
serializer_class=serializers.SerializerMethodField,
|
serializer_class=serializers.SerializerMethodField,
|
||||||
serializer_kwargs={'read_only': True},
|
serializer_kwargs={'allow_null': True, 'read_only': True},
|
||||||
filter_name='roles',
|
filter_name='roles',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user