make sure form doesn't make it possible to post to locked topic

This commit is contained in:
2025-07-04 17:35:17 +03:00
parent 7ab1c8745f
commit 4cbc66d9aa
2 changed files with 14 additions and 1 deletions

View File

@ -71,6 +71,18 @@ class Users(Model):
subscriptions.user_id = ?"""
return db.query(q, self.id)
def can_post_to_topic(self, topic):
if self.is_guest():
return False
if self.is_mod():
return True
if topic['is_locked']:
return False
return True
class Topics(Model):
table = "topics"