.
This commit is contained in:
@@ -65,6 +65,9 @@ class AuthorMixin():
|
||||
|
||||
def is_author(self, user: User) -> bool:
|
||||
"""Returns True if the user is an author of the object"""
|
||||
if user.is_superuser:
|
||||
return True
|
||||
|
||||
return self.author.filter(id=user.id).exists()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user