Browse Source

Merge branch 'master' into desuchan

desuchan
dequis 4 years ago
parent
commit
a839019c31
4 changed files with 16 additions and 7 deletions
  1. +1
    -1
      app.py
  2. +3
    -3
      board.py
  3. +3
    -2
      interboard.py
  4. +9
    -1
      wakapost.py

+ 1
- 1
app.py View File

@@ -380,7 +380,7 @@ def task_addipfrompopup(environ, start_response):
try:
if globaldelete_all:
StaffAction(kwargs['cookie'], 'delete_by_ip_global',
ip=kwargs['ip']).execute()
ip=kwargs['ip'], caller='internal').execute()
elif delete_all:
StaffAction(kwargs['cookie'], 'delete_by_ip',
ip=kwargs['ip'], board=board).execute()


+ 3
- 3
board.py View File

@@ -215,7 +215,7 @@ class Board(object):
else:
parent, replies = postlist[0], []

images = [x for x in replies if x.image]
images = [x for x in replies if x.filename]

if parent.stickied:
max_replies = config.REPLIES_PER_STICKY
@@ -231,7 +231,7 @@ class Board(object):
while len(replies) > max_replies or len(images) > max_images:
post = replies.pop(0)
thread['omit'] += 1
if post.image:
if post.filename:
thread['omitimages'] += 1

thread['posts'] = [parent] + replies
@@ -726,7 +726,7 @@ class Board(object):
subject=row.subject,
password=row.password,
comment=row.comment,
image=row.image,
image=row.filename,
size=row.size,
md5=row.md5,
width=row.width,


+ 3
- 2
interboard.py View File

@@ -435,7 +435,7 @@ def edit_admin_entry(task_data, num, comment='', ival1=None,

return Template('edit_successful')

def delete_by_ip(task_data, ip, mask='255.255.255.255'):
def delete_by_ip(task_data, ip, mask='255.255.255.255', caller=''):
task_data.contents.append(ip)
user = task_data.user

@@ -450,7 +450,8 @@ def delete_by_ip(task_data, ip, mask='255.255.255.255'):
board_name = local.environ['waka.board'].name
redir = misc.make_script_url(task='mpanel', board=board_name)

return util.make_http_forward(redir, config.ALTERNATE_REDIRECT)
if caller != 'internal':
return util.make_http_forward(redir, config.ALTERNATE_REDIRECT)

def trim_reported_posts(date=0):
mintime = 0


+ 9
- 1
wakapost.py View File

@@ -13,7 +13,7 @@ class WakaPost(object):
__slots__ = [
# columns copied directly from model.board
'num', 'parent', 'timestamp', 'lasthit', 'ip', 'date', 'name', 'trip',
'email', 'subject', 'password', 'comment', 'image', 'size', 'md5',
'email', 'subject', 'password', 'comment', 'size', 'md5',
'width', 'height', 'thumbnail', 'tn_width', 'tn_height', 'lastedit',
'lastedit_ip', '_admin_post', 'stickied', 'locked',
# extensions
@@ -171,6 +171,14 @@ class WakaPost(object):
# TODO: database migration / unfucking
self._admin_post = (value in (True, 1, 'yes', 'True', '1'))

@property
def image(self):
return self.filename

@image.setter
def image(self, value):
self.filename = value

def set_ip(self, numip, editing=None):
'''Sets the ip or the lastedit ip'''
if editing:


Loading…
Cancel
Save