def removeUser(request): userid = request.unauthenticated_userid userToRemove = request.params['couserName'] hubName = request.params['hubName'] Hubs.removeUserFromHub(hubName, userid, userToRemove) url = request.route_url('myHubs') return HTTPFound(location=url)
def isPublic(request): query = request.matchdict hubName = query['hub'] user = query['user'] chkpublic = "chkpublic" in request.params.keys() hub = db.HubInfo(user, hubName).get() hub['isPublic'] = chkpublic db.HubInfo(user, hubName).put(hub) if chkpublic: Hubs.addUserToHub(hubName, user, 'Public') elif 'Public' in hub['users']: Hubs.removeUserFromHub(hubName, user, 'Public') url = request.route_url('myHubs') return HTTPFound(location=url)