Skip to content

Commit

Permalink
Fix answer v. body
Browse files Browse the repository at this point in the history
  • Loading branch information
csnardi committed Jan 14, 2015
1 parent f7f86ca commit 92c3d10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions findspam.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def testpost(title, body, user_name, site, is_answer):
except KeyError: # There is no special logic for this rule
result.append(rule['reason'].replace("{}", "username"))
if matched_body and rule['body']:
type_of_post = "answer" if is_answer else "body"
try:
if getattr(FindSpam, "%s" % rule['validation_method'])(matched_body):
type_of_post = "answer" if is_answer else "body"
result.append(rule['reason'].replace("{}", type_of_post))
except KeyError: # There is no special logic for this rule
result.append(rule['reason'].replace("{}", "body"))
result.append(rule['reason'].replace("{}", type_of_post))
return result

@staticmethod
Expand Down

0 comments on commit 92c3d10

Please sign in to comment.