[Tracker-discuss] [issue105] Dealing with spam

Richard Jones metatracker at psf.upfronthosting.co.za
Sat Mar 24 23:59:31 CET 2007


Richard Jones added the comment:

A simple extension to avoid the other most likely spam avenue:


from roundup.exceptions import Reject

def reject_html(db, cl, nodeid, newvalues):
    if newvalues['type'] == 'text/html':
        raise Reject, 'not allowed'

def reject_manylinks(db, cl, nodeid, newvalues):
    content = newvalues['content']
    if content.count('http://') > 2:
        raise Reject, 'not allowed'

def init(db):
    db.file.audit('create', reject_html)
    db.msg.audit('create', reject_manylinks)

_______________________________________________________
Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue105>
_______________________________________________________


More information about the Tracker-discuss mailing list