Handle null user case (#10362)

This commit is contained in:
Oliver 2025-09-20 12:56:28 +10:00 committed by GitHub
parent bbfdcdce73
commit 2f357587bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -491,7 +491,7 @@ class StockItemSerializer(
def update(self, instance, validated_data):
"""Custom update method to pass the user information through to the instance."""
instance._user = self.context['user']
instance._user = self.context.get('user', None)
status_custom_key = validated_data.pop('status_custom_key', None)
status = validated_data.pop('status', None)