aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/manage.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/cgi/manage.py b/cgi/manage.py
index 45ed0c4..752b097 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -236,7 +236,7 @@ def manage(self, path_split):
username_taken = FetchOne(
'SELECT COUNT(1) as count FROM `staff` WHERE `username` = %s LIMIT 1', (self.formdata['user'],))
if not username_taken['count']:
- if self.formdata['rights'] in ['0', '1', '2', '3']:
+ if self.formdata['rights'] in [0, 1, 2, 3]:
action_taken = True
pass_hash = genPasswdHash(
self.formdata['pass'])
@@ -417,7 +417,7 @@ def manage(self, path_split):
if not post:
message = 'No se encuentra un hilo con ese ID.'
template_filename = "message.html"
- elif post['locked'] == '1':
+ elif post['locked'] == 1:
message = 'Solo se puede aplicar permasage en un hilo abierto.'
template_filename = "message.html"
else:
@@ -532,13 +532,13 @@ def manage(self, path_split):
tym = parent_time
else:
tym = post["timestamp"]
- post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, tym, board["useid"], False, '', False, False, (board["countrycode"] in ['1', '2']))
+ post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, tym, board["useid"], False, '', False, False, (board["countrycode"] in [1, 2]))
# insert new post and get its new ID
new_id = post.insert()
# save the reference (BBS = post number, IB = new ID)
- refs[old_id] = num if board['board_type'] == '1' else new_id
+ refs[old_id] = num if board['board_type'] == 1 else new_id
# this was an OP
message += "newthread = %s parentid = %s<br>" % (
@@ -549,7 +549,7 @@ def manage(self, path_split):
oldbumped = post["bumped"]
# BBS = new thread timestamp, IB = new thread ID
- newthread = post['timestamp'] if board['board_type'] == '1' else new_id
+ newthread = post['timestamp'] if board['board_type'] == 1 else new_id
parent_time = post['timestamp']
# log it
@@ -562,7 +562,7 @@ def manage(self, path_split):
old_url = "/{oldboard}/res/{oldthread}.html#{oldpost}\">&gt;&gt;{oldpost}</a>".format(
oldboard=oldboard, oldthread=oldthread, oldpost=old)
- if board['board_type'] == '1':
+ if board['board_type'] == 1:
new_url = "/{newboard}/read/{newthread}/{newpost}\">&gt;&gt;{newpost}</a>".format(
newboard=newboard, newthread=newthread, newpost=new)
else:
@@ -605,7 +605,7 @@ def manage(self, path_split):
leavemsg = True
board = setBoard(oldboard)
- if board['board_type'] == '1':
+ if board['board_type'] == 1:
thread_url = "/{newboard}/read/{newthread}".format(newboard=newboard, newthread=newthread)
else:
thread_url = "/{newboard}/res/{newthread}.html".format(newboard=newboard, newthread=newthread)
@@ -1046,7 +1046,7 @@ def manage(self, path_split):
else:
board = setBoard(dir)
deletePost(int(postid), None)
- if post['parentid'] != '0':
+ if post['parentid']:
threadUpdated(post['parentid'])
else:
regenerateFrontPages()
@@ -1547,7 +1547,7 @@ def manage(self, path_split):
'blind': filt['blind'],
'redirect_url': filt['redirect_url'],
'redirect_time': filt['redirect_time'], }
- if filt['type'] == '1':
+ if filt['type'] == 1:
startvalues['name'] = filt['from']
startvalues['word'] = ''
else:
@@ -1964,7 +1964,7 @@ def manage(self, path_split):
replies = FetchAll("SELECT `id`, `message`, `parentid` FROM posts WHERE parentid != 0 AND boardid = %s AND ip = INET6_ATON(%s) AND timestamp > %s", (board['id'], ip, since) )
for post in replies:
- deletePost(post['id'], None, '2')
+ deletePost(post['id'], None, 2)
deletedPosts += 1
deletedPostsTotal += 1