diff options
author | Terry | 2019-03-29 09:15:58 -0300 |
---|---|---|
committer | Terry | 2019-03-29 09:15:58 -0300 |
commit | 48c2355d0ac6e433769d0e3dfc5df33df405fb78 (patch) | |
tree | 72c9fb2e553c537fd946bd25d116bcca02d9f750 /cgi | |
parent | 2f7bc2a8e8daf338621736b78916f07af254ba68 (diff) | |
download | weabot-48c2355d0ac6e433769d0e3dfc5df33df405fb78.tar.gz weabot-48c2355d0ac6e433769d0e3dfc5df33df405fb78.tar.xz weabot-48c2355d0ac6e433769d0e3dfc5df33df405fb78.zip |
Fix menor en delpost + css
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/post.py | 4 | ||||
-rwxr-xr-x | cgi/weabot.py | 3 |
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 056a933..736ed85 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': |