Add author validation in collection_take_start and implement is_author method in AuthorMixin
This commit is contained in:
@@ -63,6 +63,10 @@ class AuthorMixin():
|
||||
"""Remove an author from the object"""
|
||||
self.author.remove(user)
|
||||
|
||||
def is_author(self, user: User) -> bool:
|
||||
"""Returns True if the user is an author of the object"""
|
||||
return self.author.filter(id=user.id).exists()
|
||||
|
||||
|
||||
class UserConfigurablePaginationMixin:
|
||||
default_per_page = 25
|
||||
|
||||
Reference in New Issue
Block a user