Users Services¶
- class services.users.followers.FollowersService(user: User)[source]¶
Bases:
objectService class for managing followers for a user.
This class contains methods to handle following and unfollowing operations for a user. It ensures that the operations are valid and raises exceptions if they are not.
- Attributes:
_user (User): The user who is performing the follow or unfollow operation.
- follow(following_user: User) None[source]¶
Follow a user.
This method adds the given following_user to the user’s following list after validating the operation using _validate_follow.
- Args:
following_user (User): The user to follow.
- notification_service¶
alias of
NotificationService
- exception services.users.exceptions.AlreadyFollowingUserException[source]¶
Bases:
ExceptionRaised when a user attempts to follow a user that they are already following.
- exception services.users.exceptions.NotFollowingUserException[source]¶
Bases:
ExceptionRaised when a user attempts to unfollow a user that they are not following.