Browse Source

Add option to limit delete_by_ip to recent posts

There's no option to remove the limit.
master
dequis 6 years ago
parent
commit
ecec426709
2 changed files with 6 additions and 1 deletions
  1. +4
    -1
      board.py
  2. +2
    -0
      config_defaults.py

+ 4
- 1
board.py View File

@@ -653,7 +653,10 @@ class Board(object):
session = model.Session()
table = self.table

sql = table.select().where(table.c.ip.op('&')(mask) == ip & mask)
sql = table.select().where(and_(
table.c.ip.op('&')(mask) == ip & mask,
table.c.timestamp > (time.time() - config.NUKE_TIME_THRESHOLD)
))
rows = session.execute(sql)

if not rows.rowcount:


+ 2
- 0
config_defaults.py View File

@@ -72,6 +72,8 @@ HCAPTCHA_ANSWER = 'desu'
HCAPTCHA_COOKIE_BYPASS = True
HCAPTCHA_NOKOSAGE_BYPASS = True

NUKE_TIME_THRESHOLD = 30*24*3600

# add default values to config.py
import util as _util
_util.module_default('config', locals())

Loading…
Cancel
Save