Esempio n. 1
0
def get_channel_members(
        channel: db_models.Channel = Depends(get_channel_or_fail),
        dao: Dao = Depends(get_dao),
        auth: authorization.Rules = Depends(get_rules),
):

    auth.assert_list_channel_members(channel.name)
    member_list = dao.get_channel_members(channel.name)

    return member_list
Esempio n. 2
0
def get_channel_members(
        channel: db_models.Channel = Depends(get_channel_or_fail),
        dao: Dao = Depends(get_dao)):

    member_list = dao.get_channel_members(channel.name)
    for member in member_list:
        # force loading of profile before changing attributes to prevent sqlalchemy errors.
        # TODO: don't abuse db models for this.

        member.user.profile
        setattr(member.user, 'id', str(uuid.UUID(bytes=member.user.id)))

    return member_list