def clean(self):
validation_errors = {}<EOL>if self.frequency == self.FREQUENCY_TYPE_DAILY:<EOL><INDENT>self.day_of_month = None<EOL>self.day_of_week = None<EOL><DEDENT>elif self.frequency == self.FREQUENCY_TYPE_WEEKLY:<EOL><INDENT>if self.day_of_week is None or self.day_of_week == '<STR_LIT>':<EOL><INDENT>validation_errors['<STR_LIT>'] = _('<STR_LIT>')<EOL><DEDENT>self.day_of_month = None<EOL><DEDENT>elif self.frequency == self.FREQUENCY_TYPE_MONTHLY:<EOL><INDENT>if not self.day_of_month:<EOL><INDENT>validation_errors['<STR_LIT>'] = _('<STR_LIT>')<EOL><DEDENT>self.day_of_week = None<EOL><DEDENT>else:<EOL><INDENT>validation_errors[NON_FIELD_ERRORS] = _('<STR_LIT>')<EOL><DEDENT>if self.delivery_method == self.DELIVERY_METHOD_EMAIL:<EOL><INDENT>if not self.email:<EOL><INDENT>validation_errors['<STR_LIT:email>'] = _(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>if not self.decrypted_password:<EOL><INDENT>validation_errors['<STR_LIT>'] = _(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT>elif self.delivery_method == self.DELIVERY_METHOD_SFTP:<EOL><INDENT>if not self.sftp_hostname:<EOL><INDENT>validation_errors['<STR_LIT>'] = _('<STR_LIT>')<EOL><DEDENT>if not self.sftp_username:<EOL><INDENT>validation_errors['<STR_LIT>'] = _('<STR_LIT>')<EOL><DEDENT>if not self.sftp_file_path:<EOL><INDENT>validation_errors['<STR_LIT>'] = _('<STR_LIT>')<EOL><DEDENT>if not self.decrypted_sftp_password:<EOL><INDENT>validation_errors['<STR_LIT>'] = _(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT>if validation_errors:<EOL><INDENT>raise ValidationError(validation_errors)<EOL><DEDENT>
Override of clean method to perform additional validation on frequency and day_of_month/day_of week.