예제 #1
0
def remove_account_from_circle(account: Account, circle: Circle,
                               admin: Account):
    logger.info("Removing %s from circle %s, admin=%s" %
                (account.username, circle.name, admin.username))

    _assert_can_admin_circle(admin, circle)

    circle.remove_member(account)
예제 #2
0
def remove_account_from_circle(account: Account, circle: Circle,
                               admin: Account):
    logger.info("Removing %s from circle %s, admin=%s" %
                (account.username, circle.name, admin.username))

    _assert_can_admin_circle(admin, circle)

    if not is_account_in_circle(account, circle):
        raise P2k16UserException(
            "Account isn't a member of the circle, cannot be removed")

    circle.remove_member(account)