aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rw-r--r--cgi/post.py4
-rwxr-xr-xcgi/weabot.py3
2 files changed, 3 insertions, 4 deletions
diff --git a/cgi/post.py b/cgi/post.py
index f0ee814..2c14004 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -692,9 +692,9 @@ def deletePost(postid, password, deltype='0', imageonly=False, quick=False):
if password:
if password != post['password']:
raise UserError, "No tienes permiso para eliminar este mensaje."
- if post["parentid"] == '0' and int(post["length"]) >= Settings.DELETE_FORBID_LENGTH:
+ elif post["parentid"] == '0' and int(post["length"]) >= Settings.DELETE_FORBID_LENGTH:
raise UserError, "No puedes eliminar un hilo con tantas respuestas."
- if (int(time.time()) - int(post["timestamp"])) > 86400:
+ elif (int(time.time()) - int(post["timestamp"])) > 86400:
raise UserError, "No puedes eliminar un post tan viejo."
# just update the DB if deleting only the image, otherwise delete whole post
diff --git a/cgi/weabot.py b/cgi/weabot.py
index f2bae10..237a944 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -795,7 +795,6 @@ class weabot(object):
return (post_url, ttaken)
def delete_post(self, boarddir, postid, imageonly, password, mobile=False):
- # open database
OpenDb()
# set the board
@@ -821,7 +820,7 @@ class weabot(object):
# delete posts
if board['board_type'] == '1' and len(to_delete) == 1:
# we should be deleting only one (textboard)
- # check if it's the last post and delete it completely if it is
+ # check if it's the last post and delete permanently if so
deltype = '0'
post = FetchOne("SELECT `id`, `timestamp`, `parentid` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1" % (board["id"], str(to_delete[0])))
if post['parentid'] != '0':