Users Services

class services.users.followers.FollowersService(user: User)[source]

Bases: object

Service 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.

__init__(user: User)[source]
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

unfollow(following_user: User)[source]

Unfollow a user.

This method removes the given following_user from the user’s following list after validating the operation using _validate_unfollow.

Args:

following_user (User): The user to unfollow.

exception services.users.exceptions.AlreadyFollowingUserException[source]

Bases: Exception

Raised when a user attempts to follow a user that they are already following.

exception services.users.exceptions.NotFollowingUserException[source]

Bases: Exception

Raised when a user attempts to unfollow a user that they are not following.

class services.users.unauthorized.UnauthorizedUserService[source]

Bases: object

static create_user(data: Dict, profile: Dict, interests: List, password: str) User[source]

Creates user :param data: data of user :param profile: data of user profile :param interests: list of interests :param password: raw password :return: User object

class services.users.export.ExportUserData[source]

Bases: object

classmethod export_data(user: User)[source]
class services.users.dto.AccessRefreshTokensDTO(access: str, refresh: str)[source]

Bases: object

__init__(access: str, refresh: str) None
access: str
refresh: str