Changeset 2747
- Timestamp:
- 23 Nov 2007, 17:09:05 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTables.py
r2738 r2747 1323 1323 for brain in course_results: 1324 1324 d = {} 1325 credits += int(brain.credits) 1325 if brain.credits.isdigit(): 1326 credits += int(brain.credits) 1326 1327 for field in self.schema(): 1327 1328 d[field] = getattr(brain,field,'') -
WAeUP_SRP/base/WAeUPTool.py
r2746 r2747 457 457 ###) 458 458 459 security.declarePublic('checkPassword') 459 security.declarePublic('checkPassword') ###( 460 460 def checkPassword(self,student_id,password): 461 461 student_entry = getattr(self.portal_directories.students,student_id,None) … … 463 463 return False 464 464 return getattr(student_entry,"password","not set") == password 465 466 security.declarePublic('checkGenericPassword') 465 ###) 466 467 security.declarePublic('checkGenericPassword') ###( 467 468 def checkGenericPassword(self,member_id): 468 469 member_entry = getattr(self.portal_directories.members,member_id,None) … … 477 478 logger.info('Member %s tried to log in with unsecure password %s' %(member_id,password)) 478 479 return is_unsecure 479 480 ###) 480 481 481 482 security.declareProtected(ModifyPortalContent,'editPassword') ###( … … 493 494 transaction.commit() 494 495 ###) 495 496 496 497 497 security.declarePublic('loadStudentFoto') ###( … … 1434 1434 def mass_create_course_result(self,mapping): 1435 1435 #import pdb;pdb.set_trace() 1436 students_folder = self.portal_url.getPortalObject().campus.students 1436 1437 if getattr(self,'_v_courses',None) is None: 1437 1438 res = self.courses_catalog() … … 1439 1440 for brain in res: 1440 1441 self._v_courses[brain.code] = brain 1442 if getattr(self,'_v_level_created',None) is None: 1443 self._v_level_created = [] 1441 1444 course_id = mapping.get('code') 1442 1445 if course_id not in self._v_courses.keys(): … … 1454 1457 if id_field != "student_id": 1455 1458 mapping['student_id'] = res[0].id 1459 if mapping['student_id'] not in self._v_level_created: 1460 try: 1461 context = getattr(getattr(students_folder, 1462 "%(student_id)s" % mapping), 1463 'study_course') 1464 except: 1465 return '', "could not create level %(level_id)s for %(student_id)s" % mapping 1466 if mapping['level_id'] not in context.objectIds(): 1467 context.invokeFactory('StudentStudyLevel',"%(level_id)s" % mapping) 1468 level = getattr(context,"%(level_id)s" % mapping) 1469 self.portal_workflow.doActionFor(level,'open') 1470 level.getContent().edit(mapping={'session': "%(session_id)s" % mapping}) 1471 self.portal_workflow.doActionFor(level,'close_for_edit') 1472 self._v_level_created += mapping['student_id'], 1456 1473 mapping['key'] = key = "%(student_id)s|%(level_id)s|%(code)s" % mapping 1457 1474 for k in ('semester','credits',):
Note: See TracChangeset for help on using the changeset viewer.