diff options
author | neptune | 2020-08-13 07:30:32 -0400 |
---|---|---|
committer | neptune | 2020-08-13 07:30:32 -0400 |
commit | 94b29ae7a8b3b7d93af0089c1357cf575fd7e94d (patch) | |
tree | d64a0dac51af13d75b2580ae31ff3551b9824ab7 /cgi | |
parent | 2c898d53d906bbc1897f7bde5aa63f9e3a9c6d6f (diff) | |
download | weabot-94b29ae7a8b3b7d93af0089c1357cf575fd7e94d.tar.gz weabot-94b29ae7a8b3b7d93af0089c1357cf575fd7e94d.tar.xz weabot-94b29ae7a8b3b7d93af0089c1357cf575fd7e94d.zip |
Manejada excepción en threadPage cuando un hilo no existe.
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/post.py | 6 |
1 files 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 |