Changeset 1576
- Timestamp:
- 18 Mar 2007, 14:48:06 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py
r1569 r1576 71 71 ## patch to assign dynamic roles for WAeUP 72 72 while 1: 73 break 74 if self.isStudent() or self.isSectionOfficer(): 73 #from pdb import set_trace;set_trace() 74 if self.isStudent(): 75 break 76 groups = self.portal_membership.getAuthenticatedMember().getGroups() 77 if not ("ClearanceOfficer" in groups or "CourseAdviser" in groups): 75 78 break 76 79 if callable(real_object) and hasattr(real_object,'im_self'): … … 80 83 break 81 84 if hasattr(real_object,'portal_type') and\ 82 real_object.portal_type not in ("Student","StudentClearance","StudentStudyLevel"): 85 real_object.portal_type not in ("Student", 86 "StudentClearance", 87 "StudentStudyLevel"): 83 88 break 84 89 85 #from pdb import set_trace;set_trace()86 90 # can be later simplified by replacing by students_catalog values - Henrik 87 91 # getattr works always because of acquisition ?! Henrik … … 115 119 ) 116 120 if real_object.portal_type == "StudentStudyLevel": 117 context_obj = getattr(certificate_obj,real_object.getId()) 121 if real_object.meta_type == "StudentStudyLevel": 122 #if it is not a Proxy 123 break 124 context_obj = getattr(certificate_obj,real_object.getId(),None) 125 if context_obj is None: 126 break 118 127 allowed = ('CourseAdviser', 'SectionManager') 119 128 else: -
WAeUP_SRP/trunk/skins/waeup_student/create_level.py
r1571 r1576 30 30 cert_id = student.course 31 31 current_level = student.level 32 in_progress = session.get('in_progress','finished') 33 if in_progress == 'finished': 32 in_progress = request.get('in_progress','not started') 33 34 if context.hasObject(current_level): 35 response.redirect("%s/%s" % (context.absolute_url(),current_level)) 36 return 37 38 if in_progress in ('not started','started'): 34 39 session.set('in_progress','started') 35 view = context.in_progress_view(refresh=3,page=' %s/study_level_view' % current_level)40 view = context.in_progress_view(refresh=3,page='create_level?in_progress=started') 36 41 response.setHeader('Content-type','text/html; charset=ISO-8859-15') 37 42 response.setHeader('Content-length','%d' % (len(view))) … … 39 44 response.write(view) 40 45 response.write('') 41 elif in_progress == 'started': 42 return 43 44 if context.hasObject(current_level): 45 return 46 level = getattr(context,current_level) 47 return response.redirect("%s" % level.absolute_url()) 46 if in_progress == 'started': 47 return 48 48 49 49 50 context.invokeFactory('StudentStudyLevel',"%s" % current_level) … … 105 106 d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective') 106 107 course_result.getContent().edit(mapping=d) 107 session.set('in_progress','finished')108 108 return
Note: See TracChangeset for help on using the changeset viewer.