Ekipa tab restructuring, downloaded file names are now codes.
This commit is contained in:
@@ -508,22 +508,18 @@ def get_institution_contract(institution_id):
|
||||
|
||||
|
||||
def get_institution_cooperation_history(institution_id):
|
||||
#return CooperationToken.query.join(UserCooperationTokenMapping,
|
||||
# UserCooperationTokenMapping.cooperation_token == CooperationToken.id).filter(UserCooperationTokenMapping.user == user_id).all()
|
||||
#
|
||||
res = dict()
|
||||
|
||||
uch_rows = UserCooperationHistory.query.filter_by(institution=institution_id).order_by(UserCooperationHistory.school_year.desc()).all()
|
||||
for row in uch_rows:
|
||||
if row.user not in res:
|
||||
res[row.user] = {
|
||||
'coordinator': [],
|
||||
'mentor': [],
|
||||
'other': []
|
||||
}
|
||||
res[row.user][row.role].append((row.school_year, row.badge_text))
|
||||
|
||||
return res
|
||||
return db.session.query(UserCooperationHistory.role,
|
||||
UserCooperationHistory.school_year,
|
||||
UserCooperationHistory.badge_text,
|
||||
RegisteredUser.name,
|
||||
).select_from(
|
||||
UserCooperationHistory,
|
||||
).join(
|
||||
RegisteredUser,
|
||||
UserCooperationHistory.user == RegisteredUser.id,
|
||||
).filter(
|
||||
UserCooperationHistory.institution == institution_id,
|
||||
).order_by(UserCooperationHistory.school_year.desc()).all()
|
||||
|
||||
|
||||
def get_cooperation_history():
|
||||
|
||||
Reference in New Issue
Block a user