Skip to content

Commit

Permalink
do not attempt to parse "hb"
Browse files Browse the repository at this point in the history
  • Loading branch information
normalhuman committed Jun 8, 2016
1 parent b7ee655 commit a81cb14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spamhandling.py
Expand Up @@ -46,8 +46,11 @@ def check_if_spam(title, body, user_name, user_url, post_site, post_id, is_answe


def check_if_spam_json(json_data):
text_data = json.loads(json_data)["data"]
if text_data == "hb":
return False, None, ""
try:
data = json.loads(json.loads(json_data)["data"])
data = json.loads(text_data)
except ValueError:
GlobalVars.charcoal_hq.send_message(u"Encountered ValueError parsing the following:\n{0}".format(json_data), False)
return False, None, ""
Expand Down

0 comments on commit a81cb14

Please sign in to comment.