mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
forum and core: remove CanViewSearchMixin and use specialized view instead
This commit is contained in:
1 parent
1de77f2fdd
commit
884855c178
3 files changed
+13
-29
No files matched your search
+3
-3
@@ -331,9 +331,9 @@ class ForumMessage(models.Model):
|
||||
return user.can_edit(self.topic.forum)
|
||||
|
||||
def can_be_viewed_by(self, user):
|
||||
return not self._deleted and self.topic.can_be_viewed_by(
|
||||
user
|
||||
) # Useful in search engine
|
||||
# No need to check the real rights since it's already done by the Topic view
|
||||
# and it impacts performances too much
|
||||
return not self._deleted
|
||||
|
||||
def can_be_moderated_by(self, user):
|
||||
return self.topic.forum.is_owned_by(user) or user.id == self.author.id
|
||||
|
||||
Reference in new issue
Block a user