def save(self): if not self.is_valid(): raise Exception('The form must be valid in order to save') start_ts = self.cleaned_data['start_ts'] end_ts = self.cleaned_data['end_ts'] message = self.cleaned_data['message'] delay_ms = self.cleaned_data['delay_ms'] motd = MOTD(start_ts=start_ts, end_ts=end_ts, message=message, delay_ms=delay_ms) motd.save() return motd