Skip to content

Commit

Permalink
AutoMod: convert value to str to validate regex
Browse files Browse the repository at this point in the history
Previously something like "combined_karma: 0" would not be able to be
validated against the regex, because the yaml parser would have made the
value into an int, and regex can only be applied to strings.
  • Loading branch information
Deimos committed Apr 13, 2015
1 parent 33dc1c8 commit d55c468
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion r2/r2/lib/automoderator.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def validate(self, value):
if value not in self.valid_values:
return False
if self.valid_regex:
if not self.valid_regex.search(value):
if not self.valid_regex.search(str(value)):
return False

return True
Expand Down

0 comments on commit d55c468

Please sign in to comment.