Пример #1
0
def addUser(request):
    newUser = request.params['userEmail']
    hubName = request.params['hubName']
    owner = request.params['owner']

    Hubs.addUserToHub(hubName, owner, newUser)

    url = request.route_url('myHubs')
    return HTTPFound(location=url)
Пример #2
0
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)