def METHOD_NAME(self, attrs):
    attrs = super(TransactionSerializer, self).METHOD_NAME(attrs)
    if not attrs:
        return attrs
    if self.instance:
        if self.instance.state != Transaction.States.Initial:
            message = "The transaction cannot be modified once it is in {}"\
                      " state.".format(self.instance.state)
            raise serializers.ValidationError(message)
    return attrs