def get(team_id): """ Verify the logged in user has access to the requested team and return that teams list of domains. :param team_id: :return: List of domain objects for the team [{'id':domain_id,'name','name':domainname,'description':domaindescription},..] """ user = helper.get_user() if not db.hasTeamAccess(user.get_email(),team_id): tangelo.content_type() tangelo.http_status(401) tangelo.log("401 Unauthorized domains/?team_id="+str(team_id)+" user: "******"401 Unauthorized" else: results = db.get_domains(team_id) return json.dumps(results)
def get(team_id): """ Verify the logged in user has access to the requested team and return that teams list of domains. :param team_id: :return: List of domain objects for the team [{'id':domain_id,'name','name':domainname,'description':domaindescription},..] """ user = helper.get_user() if not db.hasTeamAccess(user.get_email(), team_id): tangelo.content_type() tangelo.http_status(401) tangelo.log("401 Unauthorized domains/?team_id=" + str(team_id) + " user: "******"401 Unauthorized" else: results = db.get_domains(team_id) return json.dumps(results)
def get_domains(*args): domains = db.get_domains() return json.dumps(map(lambda x: dict(name=x[0], description=x[1]), domains))
def get(): results = db.get_domains() results = map(lambda x: {'name': x[0], 'description': x[1]}, results) return json.dumps(results)
def get(): results = db.get_domains() results = map(lambda x: {"name": x[0], "description": x[1]}, results) return json.dumps(results)