add a redirct view mixin
This commit is contained in:
@@ -186,6 +186,16 @@ class QuestionBase(models.Model, AuthorMixin, QuestionMixin):
|
||||
"""If this makes sense in the question/answer context override"""
|
||||
return None
|
||||
|
||||
def can_edit(self, user: User) -> bool:
|
||||
"""Returns True if the user can edit the question"""
|
||||
if user.is_superuser:
|
||||
return True
|
||||
|
||||
if user in self.get_author_objects():
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
class SeriesImageBase(models.Model):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user