def _validate(self, value): super()._validate(value) exists = password_exists(value) if self._should_exist and not exists: self.fail("should_exist", name=value) elif not self._should_exist and exists: self.fail("should_not_exist", name=value)
def _validate(self, value): super()._validate(value) exists = password_exists(value) if self._should_exist and not exists: raise self.make_error("should_exist", name=value) if not self._should_exist and exists: raise self.make_error("should_not_exist", name=value)