コード例 #1
0
def set_user(user):
    teams = datawake_mysql.getTeams(email=user.get_email())
    if len(teams) == 0:
        # create a team with just this user
        teams = [ datawake_mysql.createTeam(user.get_email(),'Auto generated private team.',emails=[user.get_email()]) ]
    user.set_teams(teams)
    cherrypy.session['user'] = user
    return True
コード例 #2
0
ファイル: teams.py プロジェクト: nagyistge/Datawake
def get():
    """
    Return valid teams for the current user.
   [{id: team_id, name:team_name},..]
    """
    user = helper.get_user()
    teams = db.getTeams(user.get_email())
    return json.dumps(teams)
コード例 #3
0
ファイル: teams.py プロジェクト: mrG7/Datawake
def get():
    """
    Return valid teams for the current user.
   [{id: team_id, name:team_name},..]
    """
    user = helper.get_user()
    teams = db.getTeams(user.get_email())
    return json.dumps(teams)
コード例 #4
0
ファイル: helper.py プロジェクト: brandontheis/Datawake
def set_user(user):
    """
    Set the user object.
    If this user is loging in for the first time automatically create a private team and a blank domain
    :param user:
    :return:
    """
    teams = datawake_mysql.getTeams(email=user.get_email())
    if len(teams) == 0:
        # create a team for the new user.
        (team_id,team_name) = datawake_mysql.createTeam(user.get_email(),'Auto generated private team.',emails=[user.get_email()])

        teams = [ (team_id,team_name) ]
        datawake_mysql.add_new_domain(team_id,"Empty", "An empty domain. Created by default for each team.")
    user.set_teams(teams)
    cherrypy.session['user'] = user
    return True
コード例 #5
0
def set_user(user):
    """
    Set the user object.
    If this user is loging in for the first time automatically create a private team and a blank domain
    :param user:
    :return:
    """
    teams = datawake_mysql.getTeams(email=user.get_email())
    if len(teams) == 0:
        # create a team for the new user.
        (team_id,
         team_name) = datawake_mysql.createTeam(user.get_email(),
                                                'Auto generated private team.',
                                                emails=[user.get_email()])

        teams = [(team_id, team_name)]
        datawake_mysql.add_new_domain(
            team_id, "Empty",
            "An empty domain. Created by default for each team.")
    user.set_teams(teams)
    cherrypy.session['user'] = user
    return True