diff MoinMoin/security/antispam.py @ 1550:a4f0632414da

using request.cfg.cache more
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 14 Sep 2006 22:49:42 +0200
parents 862edd1566bb
children d9077dcd38e1
line wrap: on
line diff
--- a/MoinMoin/security/antispam.py	Thu Sep 14 22:08:45 2006 +0200
+++ b/MoinMoin/security/antispam.py	Thu Sep 14 22:49:42 2006 +0200
@@ -162,7 +162,7 @@
             request.clock.start('antispam')
 
             blacklist = []
-            invalidate_cache = not getattr(request.cfg, "_mmblcache", None)
+            invalidate_cache = not getattr(request.cfg.cache, "antispam_blacklist", None)
             for pn in BLACKLISTPAGES:
                 do_update = (pn != "LocalBadContent")
                 invalidate_cache_necessary, blacklist_entries = getblacklist(request, pn, do_update)
@@ -178,7 +178,7 @@
                         except re.error, err:
                             dprint("Error in regex '%s': %s. Please check the pages %s." % (blacklist_re, str(err), ', '.join(BLACKLISTPAGES)))
                             continue
-                    request.cfg._mmblcache = mmblcache
+                    request.cfg.cache.antispam_blacklist = mmblcache
 
                 from MoinMoin.Page import Page
 
@@ -192,7 +192,7 @@
                 difference = newset.difference(oldset)
                 addedtext = ''.join(difference)
 
-                for blacklist_re in request.cfg._mmblcache:
+                for blacklist_re in request.cfg.cache.antispam_blacklist:
                     match = blacklist_re.search(addedtext)
                     if match:
                         # Log error and raise SaveError, PageEditor