Browse Source

Prevent replying to self in locked topics

I think it's time to refactor the ACL methods.
merge-requests/25/head
Deimos 6 years ago
parent
commit
3fed4783f7
  1. 3
      tildes/tildes/models/comment/comment.py

3
tildes/tildes/models/comment/comment.py

@ -170,7 +170,8 @@ class Comment(DatabaseModel):
acl.append((Allow, 'admin', 'view'))
acl.append((Allow, self.user_id, 'view'))
acl.append((Allow, self.user_id, 'reply'))
if not self.topic.is_locked:
acl.append((Allow, self.user_id, 'reply'))
acl.append((Allow, self.user_id, 'edit'))
acl.append((Allow, self.user_id, 'delete'))

Loading…
Cancel
Save