mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 21:38:48 +00:00
Bug fix for attachment updating (#8362)
- Closes https://github.com/inventree/InvenTree/issues/8354
This commit is contained in:
parent
0ae9cdd39f
commit
5af0e50b79
@ -546,6 +546,10 @@ class AttachmentSerializer(InvenTreeModelSerializer):
|
||||
|
||||
model_type = self.validated_data.get('model_type', None)
|
||||
|
||||
# If the model type is not specified, attempt to infer it from the instance
|
||||
if model_type is None and self.instance:
|
||||
model_type = self.instance.model_type
|
||||
|
||||
# Ensure that the user has permission to attach files to the specified model
|
||||
user = self.context.get('request').user
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user