Commit 73753983 authored by ale's avatar ale
Browse files

tiny fix for unbound local variable

parent a908094d
......@@ -86,6 +86,8 @@ class NoSpam(object):
# Find all the outgoing links in the comment text, and add
# them to the comment dictionary under the '_urls' key.
comment['_urls'] = self._extract_urls(comment)
# Compute the 'nice' site name (domain only, no http:// prefix).
site = _extract_domain(comment['site'])
# Test all plugins, then compare the total score against the
# spam threshold.
results = []
......@@ -102,7 +104,6 @@ class NoSpam(object):
comment['train'] = 'spam'
self.classify(comment)
msg = ', '.join([x[1] for x in results if x[0] > 0])
site = _extract_domain(comment['site'])
log.info('spam: site=%s score=%g %s' % (site, tot_score, msg))
self._incr_counter('spam', site)
return (True, tot_score, msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment