Skip to content

Commit 5af0e50

Browse files
Bug fix for attachment updating (#8362)
- Closes #8354
1 parent 0ae9cdd commit 5af0e50

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/InvenTree/common/serializers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ def save(self):
546546

547547
model_type = self.validated_data.get('model_type', None)
548548

549+
# If the model type is not specified, attempt to infer it from the instance
550+
if model_type is None and self.instance:
551+
model_type = self.instance.model_type
552+
549553
# Ensure that the user has permission to attach files to the specified model
550554
user = self.context.get('request').user
551555

0 commit comments

Comments
 (0)