source: WAeUP_SRP/trunk/skins/waeup_utilities/refresh_certificate_info.py @ 11154

Last change on this file since 11154 was 5607, checked in by Henrik Bettermann, 14 years ago

refresh_certificate_info.py: Simplify reindexing.

getInterswitchParams.py: Include 100 level fresh students.

File size: 988 bytes
Line 
1##parameters=REQUEST, certid=None
2# $Id: refresh_certificate_info.py 1094 2006-12-19 12:11:44Z henrik $
3"""
4refresh the certificate info in the students_catalog
5"""
6request = context.REQUEST
7if not certid:
8    return "Certificate not specified"
9
10course = request.get('certid')
11res = context.certificates_catalog(code = course)
12if not res:
13    return "Certificate %s not found"
14faculty = res[0].faculty
15department = res[0].department
16s_cat = context.students_catalog
17s_res = s_cat(course = certid)
18#from Products.zdb import set_trace
19#set_trace()
20if not s_res:
21    return "No students for %s not found"
22refreshed = []
23refreshed.append("Record started")
24for student_id in [st.id  for st in s_res]:
25    s_cat.modifyRecord(id = student_id,
26                       faculty = faculty,
27                       department = department,
28                       )
29    refreshed.append("Record %s refreshed, faculty = %s, department = %s" % (student_id,faculty,department))
30return '\r'.join(refreshed)
Note: See TracBrowser for help on using the repository browser.