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

Last change on this file since 7008 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
RevLine 
[1253]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')
[5607]11res = context.certificates_catalog(code = course)
[1253]12if not res:
13    return "Certificate %s not found"
[5607]14faculty = res[0].faculty
15department = res[0].department
[1253]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                       )
[5607]29    refreshed.append("Record %s refreshed, faculty = %s, department = %s" % (student_id,faculty,department))
[1253]30return '\r'.join(refreshed)
Note: See TracBrowser for help on using the repository browser.