예제 #1
0
    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)
예제 #2
0
    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)