function clean() { $d = $this->cleaned_data; if (isset($d['from_ref']) && isset($d['into_ref'])) { if ($this->cleaned_data['from_ref'] == $this->cleaned_data['into_ref']) { throw new ValidationError("source and destination journos must be different"); } } return parent::clean(); }