Skip to content

Commit

Permalink
Bug fix for attachment updating (#8362)
Browse files Browse the repository at this point in the history
-  Closes #8354
  • Loading branch information
SchrodingersGat authored Oct 25, 2024
1 parent 0ae9cdd commit 5af0e50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/backend/InvenTree/common/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ def save(self):

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

Expand Down

0 comments on commit 5af0e50

Please sign in to comment.