Skip to content

Commit a74d809

Browse files
authored
Fix Schema Nullables (#11092)
* Add missing nullable annotations * bump API version
1 parent 70fcaa7 commit a74d809

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/backend/InvenTree/InvenTree/api_version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
"""InvenTree API version information."""
22

33
# InvenTree API version
4-
INVENTREE_API_VERSION = 438
4+
INVENTREE_API_VERSION = 439
55
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
66

77
INVENTREE_API_TEXT = """
88
9+
v439 -> 2026-01-09 : https://github.com/inventree/InvenTree/pull/11092
10+
- Add missing nullable annotations
11+
912
v438 -> 2026-01-09 : https://github.com/inventree/InvenTree/pull/11104
1013
- Adds a simpler / faster health check endpoint at /api/system/health/
1114

src/backend/InvenTree/build/serializers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,9 @@ class Meta:
13781378
)
13791379

13801380
allocations = enable_filter(
1381-
BuildItemSerializer(many=True, read_only=True, build_detail=False),
1381+
BuildItemSerializer(
1382+
many=True, read_only=True, allow_null=True, build_detail=False
1383+
),
13821384
True,
13831385
prefetch_fields=[
13841386
'allocations',
@@ -1426,6 +1428,7 @@ class Meta:
14261428
source='bom_item',
14271429
many=False,
14281430
read_only=True,
1431+
allow_null=True,
14291432
pricing=False,
14301433
substitutes=False,
14311434
sub_part_detail=False,
@@ -1455,6 +1458,7 @@ class Meta:
14551458
source='bom_item.sub_part',
14561459
many=False,
14571460
read_only=True,
1461+
allow_null=True,
14581462
pricing=False,
14591463
),
14601464
False,

src/backend/InvenTree/common/serializers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,9 @@ def save(self, **kwargs):
808808
)
809809

810810
updated_by_detail = enable_filter(
811-
UserSerializer(source='updated_by', read_only=True, many=False),
811+
UserSerializer(
812+
source='updated_by', read_only=True, allow_null=True, many=False
813+
),
812814
True,
813815
prefetch_fields=['updated_by'],
814816
)

0 commit comments

Comments
 (0)