@@ -251,7 +251,7 @@ def post_stuff(self, parent, name, email, subject, comment, file,
251
251
timestamp = time .time ()
252
252
253
253
# Initialize admin_post variable--tells whether or not this post has fallen under the hand of a mod/admin
254
- admin_post = ''
254
+ admin_post = False
255
255
256
256
# check that the request came in as a POST, or from the command line
257
257
if local .environ .get ('REQUEST_METHOD' , '' ) != 'POST' :
@@ -268,16 +268,15 @@ def post_stuff(self, parent, name, email, subject, comment, file,
268
268
elif not admin_post_mode :
269
269
sticky = 0
270
270
271
- # TODO use True/False instead of 'yes'?
272
- if sticky_check ['locked' ] == 'yes' and not admin_post_mode :
271
+ if sticky_check ['locked' ] and not admin_post_mode :
273
272
raise WakaError (strings .THREADLOCKEDERROR )
274
273
275
274
username = accounttype = ''
276
275
277
276
# check admin password - allow both encrypted and non-encrypted
278
277
if admin_post_mode :
279
278
username , accounttype = misc .check_password (admin , 'mpost' )
280
- admin_post = 'yes' # TODO use True/False?
279
+ admin_post = True
281
280
else :
282
281
if no_captcha or no_format or (sticky and not parent ) or lock :
283
282
raise WakaError (strings .WRONGPASS )
@@ -302,8 +301,8 @@ def post_stuff(self, parent, name, email, subject, comment, file,
302
301
303
302
if lock :
304
303
if parent :
305
- threadupdate = threadupdate .values (locked = 'yes' )
306
- lock = 'yes' # TODO use True/False?
304
+ threadupdate = threadupdate .values (locked = True )
305
+ lock = True
307
306
308
307
if (sticky or lock ) and parent :
309
308
session .execute (threadupdate )
@@ -625,10 +624,7 @@ def process_file(self, filestorage, timestamp, parent):
625
624
if not width : # unsupported file
626
625
if ext in filetypes : # externally defined filetype
627
626
# Compensate for absolute paths, if given.
628
- if filetypes [ext ].startswith ("/" ):
629
- icon = filetypes [ext ][1 :] # FIXME: wtf is wakaba doing here
630
- else :
631
- icon = os .path .join (self .path , filetypes [ext ])
627
+ icon = os .path .join (self .path , filetypes [ext ].lstrip ("/" ))
632
628
633
629
tn_ext , tn_width , tn_height = \
634
630
analyze_image (open (icon , "rb" ), icon )
0 commit comments