From 94b29ae7a8b3b7d93af0089c1357cf575fd7e94d Mon Sep 17 00:00:00 2001 From: neptune Date: Thu, 13 Aug 2020 07:30:32 -0400 Subject: Manejada excepción en threadPage cuando un hilo no existe. --- cgi/post.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cgi/post.py b/cgi/post.py index e27b971..6fc4bac 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -515,9 +515,11 @@ def threadPage(postid, mobile=False, timestamp=0): else: template_filename = "board.html" - threads = [getThread(postid, mobile, timestamp)] + thread = getThread(postid, mobile, timestamp) + if not thread: + raise UserError, "El hilo no existe." - return renderTemplate(template_filename, {"threads": threads, "replythread": postid}, mobile) + return renderTemplate(template_filename, {"threads": [thread], "replythread": postid}, mobile) def dynamicRead(parentid, ranges, mobile=False): import re -- cgit v1.2.1-18-gbd029