示例#1
0
 def projects_users(
         self, project_id,
         campus_id):  #return projects users of specify projet and campus
     pu = []
     ret = ic.scrap("projects/{}/projects_users?filter[campus]={}".format(
         project_id, campus_id))
     for cu in ret:
         pu.append(cu)
     return (pu)
示例#2
0
 def user_validated(self, project_id, campus_id, range_validated
                    ):  #return projects users of specify projet and campus
     users = []
     ret = ic.scrap(
         "projects/{}/projects_users?filter[campus]={}&range[final_mark]={}"
         .format(project_id, campus_id, range_validated))
     for cu in ret:
         users.append(cu['user']['login'])
     return (users)
示例#3
0
def GetActiveUsersNewCursus():
    new_cursus = []
    staff = staff.all()

    ret = ic.scrap("cursus/21/cursus_users?filter[campus_id]=1&range[begin_at]=2019-09-16,2021-12-25")
    for j in ret:
        if j['user']['login'] not in staff:
            if j['end_at'] == None:
                new_cursus.append(j['user']['login'])
    return new_cursus
示例#4
0
 def promotion(
     self, cursus_id, range_begin
 ):  # get all users in a promotion. range need to be "aaaa-mm-jj,aaaa-mm-jj"
     users = []
     ret = ic.scrap(
         "cursus/{}/cursus_users?filter[campus_id]=1&range[begin_at]={}".
         format(cursus_id, range_begin))
     for cu in ret:
         users.append(cu['user']['login'])
     return (users)
示例#5
0
 def all(self):  # get all staff accounts
     users = []
     ret = ic.scrap("users?filter[staff?]=true")
     for cu in ret:
         users.append(cu['login'])
     return (users)