mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
AutoMod: fix bug with int account threshold checks
It should be valid to define a check for one of the account thresholds
similar to:
author:
comment_karma: 0
to check for exactly that value. However, since this is parsed in as an
int, trying to do a regex match on it (to check for the presence of an
operator - equal/greater-than/less-than sign) crashes.
This ensures that the comparison value is converted to a string so that
the rest of the code can handle it.
This commit is contained in:
@@ -874,7 +874,7 @@ class RuleTarget(object):
|
||||
for threshold in thresholds:
|
||||
compare_value = getattr(self, threshold, None)
|
||||
if compare_value is not None:
|
||||
checks[threshold] = compare_value
|
||||
checks[threshold] = str(compare_value)
|
||||
|
||||
# if we don't need to actually check anything, just return True
|
||||
if not checks:
|
||||
|
||||
Reference in New Issue
Block a user