Changeset 2873 for WAeUP_SRP/base/skins/waeup_student
- Timestamp:
- 7 Dec 2007, 07:32:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/search_students.py
r2431 r2873 12 12 list Students for ClearanceOfficers 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 14 19 import logging 15 20 logger = logging.getLogger('Skins.search_students') … … 66 71 certificate_levels = fget('certificate_levels') 67 72 dep_str = fac_str = certificate_levels_str = '' 68 69 73 if "ClearanceOfficers" in member.getGroups(): 70 74 state = "clearance_requested" … … 102 106 ca_view = True 103 107 if certificate_levels: 104 #from Products.zdb import set_trace;set_trace()105 108 certificate_levels_str = certificate_levels 106 109 certificate_levels = certificate_levels.split() … … 109 112 In('localUsersWithRoles', ("user:%s" % member,)) 110 113 res = aq_portal(query) 111 112 114 logger.info('CourseAdviser %s initiated student_search' % member) 113 115 certificate_levels = [] 114 116 if res: 115 117 certificate_levels = ['/'.join(f.getPath().split('/')[-2:]) for f in res] 118 cert_ids = [] 119 level_ids = [] 120 for cl in certificate_levels: 121 c,l = cl.split('/') 122 level_ids += l, 123 if c not in cert_ids: 124 cert_ids += c, 125 cert_brains = aq_portal(In("id",cert_ids)) 126 end_levels = {} 127 for cert_brain in cert_brains: 128 end_levels[cert_brain.getId] = cert_brain.getObject().getContent().end_level 129 for cl in certificate_levels[:]: 130 c,l = cl.split('/') 131 for prob in (10,20): 132 certificate_levels += "%s/%s" % (c,int(l) + prob), 133 if l == end_levels[c]: 134 certificate_levels += "%s/%s" % (c,int(l) + 100), 116 135 user_info['certificate_levels'] = certificate_levels 117 136 certificate_levels_str = " ".join(certificate_levels)
Note: See TracChangeset for help on using the changeset viewer.