From 1d13c1f4daec0a9ce188017ad3ea140a2c3698b2 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 12 Mar 2023 20:02:50 +0200 Subject: [PATCH] fix 500 error --- files/classes/comment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index c6c100729..00a077346 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -68,7 +68,11 @@ def add_options(self, body, v): if o.voted(v): option_body += " checked" if v: - sub = self.sub + if kind == 'post': + sub = self.sub + else: + sub = self.parent.sub + if sub in {'furry','vampire','racist','femboy'} and not v.house.lower().startswith(sub): option_body += ' disabled ' option_body += f''' data-nonce="{g.nonce}" data-onclick="poll_vote_{o.exclusive}('{o.id}', '{self.id}', '{kind}')"''' else: