We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ae9cdd commit 5af0e50Copy full SHA for 5af0e50
src/backend/InvenTree/common/serializers.py
@@ -546,6 +546,10 @@ def save(self):
546
547
model_type = self.validated_data.get('model_type', None)
548
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
+
553
# Ensure that the user has permission to attach files to the specified model
554
user = self.context.get('request').user
555
0 commit comments