Fixed #28906 -- Removed unnecessary bool() calls.

This commit is contained in:
Tim Graham 2017-12-07 17:13:07 -05:00 committed by GitHub
parent 02d9419fe3
commit 2b81faab25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 10 deletions

View file

@ -54,7 +54,7 @@ class RegexValidator:
Validate that the input contains (or does *not* contain, if
inverse_match is True) a match for the regular expression.
"""
regex_matches = bool(self.regex.search(str(value)))
regex_matches = self.regex.search(str(value))
invalid_input = regex_matches if self.inverse_match else not regex_matches
if invalid_input:
raise ValidationError(self.message, code=self.code)