def _validate(self, options): """ Raises a ValidationError if validation fails. """ failed = validate(options) if not 'url' in options or not validate_url(options['url']): failed.append('url') if len(failed) > 0: raise ValidationError('Validation error.', failed)
def _validate(self, options): """ Raises a ValidationError if validation fails. """ failed = validate(options) if not 'pattern' in options or not 'intervals' in options['pattern'] \ or not validate_list(options['pattern']['intervals']): failed.append('pattern') if len(failed) > 0: raise ValidationError('Validation error.', failed)
def _validate(self, options): """ Raises a ValidationError if validation fails. """ failed = validate(options) if not "url" in options or not validate_url(options["url"]): failed.append("url") if ( not "pattern" in options or not "intervals" in options["pattern"] or not validate_list(options["pattern"]["intervals"]) ): failed.append("pattern") if len(failed) > 0: raise ValidationError("Validation error.", failed)
def _validate(self, options): """ Raises a ValidationError if validation fails. """ failed = validate(options) if len(failed) > 0: raise ValidationError('Validation error.', failed)