Ejemplo n.º 1
0
def get_user_profile(user_id):
    """
    :param user_id:
    :return:
    :parameter phone_number(Bool)
    :error
        NO_SUCH_ELEMENT
    """
    user_data = auth_service.check_permission()
    is_checked_phone_number = StringUtils.to_bool(
        request.args.get('phone_number'))
    if is_checked_phone_number and user_service.is_checked_phone_number(
            user_data.get('id'), user_id):
        is_checked_phone_number = True
    else:
        is_checked_phone_number = False
    user = user_service.get_user(user_id)
    is_favorited = False
    if user_service.get_favorite(user_data.get('id'), user.id) is not None:
        is_favorited = True
    return UserDTO(user,
                   is_checked_phone_number=is_checked_phone_number,
                   is_favorited=is_favorited), None
Ejemplo n.º 2
0
 def __init__(self, request_json):
     self.hide_on_searching = StringUtils.to_bool(request_json.get('hide_on_searching'))