The discovery of a type Ia supernova at a redshift of 0.31