Update follow and unfollow to use UserFollowRequest & UserFollows.
This commit is contained in:
@ -2,4 +2,4 @@
|
||||
from .book import Book, Work, Edition, Author
|
||||
from .shelf import Shelf, ShelfBook
|
||||
from .status import Status, Review, Favorite, Tag, Notification
|
||||
from .user import User, UserRelationship, FederatedServer
|
||||
from .user import User, FederatedServer, UserFollows, UserFollowRequest, UserBlocks
|
||||
|
@ -109,6 +109,14 @@ class UserFollows(UserRelationship):
|
||||
def status(self):
|
||||
return 'follows'
|
||||
|
||||
@classmethod
|
||||
def from_request(cls, follow_request):
|
||||
return cls(
|
||||
user_subject=follow_request.user_subject,
|
||||
user_object=follow_request.user_object,
|
||||
relationship_id=follow_request.relationship_id,
|
||||
)
|
||||
|
||||
class UserFollowRequest(UserRelationship):
|
||||
@property
|
||||
def status(self):
|
||||
|
Reference in New Issue
Block a user