src/policy/api_v1/serializers.py
def update(self, instance, validated_data):
        """
        Update and return an existing `Quote` instance, given the validated data.
        """
        # this check will prevent it from update to the same state
        if instance.state != validated_data.get('status'):
            instance.state = validated_data.get('status')
            instance.save()
            PolicyHistory.objects.create(policy=instance, state=instance.state)
        return instance

        Update and return an existing `Quote` instance, given the validated data.
        
Update and return an existing `Quote` instance, given the validated data.
Update and return an existing ` Quote ` instance given the validated data .
def update(self, instance, validated_data):
        if instance.state != validated_data.get('status'):
            instance.state = validated_data.get('status')
            instance.save()
            PolicyHistory.objects.create(policy=instance, state=instance.state)
        return instance
def update ( self , instance , validated_data ) : if instance . state != validated_data . get ( 'status' ) : instance . state = validated_data . get ( 'status' ) instance . save ( ) PolicyHistory . objects . create ( policy = instance , state = instance . state ) return instance
Update and return an existing `Quote` instance, given the validated data.
Update and return an existing ` Quote ` instance given the validated data .
"""
        Update and return an existing `Quote` instance, given the validated data.
        """ # this check will prevent it from update to the same state
self
instance
validated_data