aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/manage.py2
-rwxr-xr-xcgi/weabot.py12
2 files changed, 4 insertions, 10 deletions
diff --git a/cgi/manage.py b/cgi/manage.py
index 4361f98..496ae30 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -410,7 +410,7 @@ def manage(self, path_split):
board = setBoard(oldboardid)
oldboard = board['dir']
oldboardsubject = board['subject']
- oldboardname = board['anonymous']
+ oldboardname = random.choice(board["anonymous"].split('|'))
# get old posts
posts = FetchAll("SELECT * FROM `posts` WHERE (`id` = {0} OR `parentid` = {0}) AND `boardid` = {1} ORDER BY id ASC".format(oldthread, board['id']))
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 8d352a7..a02777f 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -474,12 +474,6 @@ class weabot(object):
if ball:
post["message"] += '<hr />' + magic_ball()
- # remove sage from wrong fields
- if post["name"].lower() == 'sage':
- post["name"] = random.choice(board["anonymous"].split('|'))
- if post["subject"].lower() == 'sage':
- post["subject"] = board["subject"]
-
if not post["parentid"] and post["email"].lower() == 'sage':
post["email"] = ""
@@ -586,10 +580,10 @@ class weabot(object):
if file and board['allow_images'] == '0':
raise UserError, _("No images allowed.")
- # use default values when missing
- if not post["name"] and not post["tripcode"]:
+ # use default values when missing / remove sage from wrong fields
+ if (not post["name"] and not post["tripcode"]) or (post["name"].lower() == 'sage'):
post["name"] = random.choice(board["anonymous"].split('|'))
- if not post["subject"] and not post["parentid"]:
+ if (not post["subject"] and not post["parentid"]) or (post["subject"].lower() == 'sage'):
post["subject"] = board["subject"]
if not post["message"]:
post["message"] = board["message"]