Beispiel #1
0
    def team_user_profile(cls, user_id, team_id, admin_search=False):
        profile = UserDatabaseClient.get_user_profile(user_id)
        cls.logger().info(f"Retrieved user #{user_id} profile.")
        output_profile = cls._generate_user_profile(profile)

        if admin_search or any(
                list(
                    map(lambda team: team.get("id") == team_id,
                        output_profile.get("teams")))):
            return SuccessfulFullUserResponse(output_profile)
Beispiel #2
0
 def user_profile(cls, user_data):
     user = Authenticator.authenticate(user_data)
     profile = UserDatabaseClient.get_user_profile(user.id)
     cls.logger().info(f"Retrieved user #{user.id} profile.")
     return SuccessfulFullUserResponse(cls._generate_user_profile(profile))