make sure form doesn't make it possible to post to locked topic
This commit is contained in:
@ -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"
|
||||
|
Reference in New Issue
Block a user