Changeset 2396 for WAeUP_SRP/base


Ignore:
Timestamp:
19 Oct 2007, 14:17:29 (17 years ago)
Author:
joachim
Message:

added remove_students

Location:
WAeUP_SRP/base
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTables.py

    r2368 r2396  
    459459    ###)
    460460
     461    security.declarePublic("missingValue")###(
     462    def missingValue(self):
     463        from Missing import MV
     464        return MV
     465    ###)
    461466###)
    462467
     
    538543            return 2
    539544        return -3
    540 
    541545InitializeClass(PinTable)
    542 
    543546###)
    544547
     
    10831086            return
    10841087        rpl = infos['rpath'].split('/')
    1085         if pt == 'Student' and mt == 'CPS Proxy Folder'\
    1086            and event_type == "sys_add_object":
     1088        if pt == 'Student' and mt == 'CPS Proxy Folder':
    10871089            student_id = object.id
    1088             try:
    1089                 self.addRecord(id = student_id)
    1090             except ValueError:
    1091                 pass
    1092             return
     1090            if event_type == "sys_add_object":
     1091                try:
     1092                    self.addRecord(id = student_id)
     1093                except ValueError:
     1094                    pass
     1095                return
     1096            elif event_type == 'sys_del_object':
     1097                self.deleteRecord(student_id)
     1098                #import pdb;pdb.set_trace()
    10931099        elif pt == 'StudentCourseResult' and mt == 'CPS Proxy Folder':
    10941100            if event_type not in ("sys_add_object","sys_del_object"):
     
    11081114            if not registered_courses:
    11091115                registered_courses = []
    1110             #import pdb;pdb.set_trace()
    11111116            if event_type == "sys_add_object":
    11121117                if course_id not in registered_courses:
  • WAeUP_SRP/base/WAeUPTool.py

    r2364 r2396  
    690690    ###)
    691691
     692    security.declareProtected(ModifyPortalContent,'removePictureFolder') ###(
     693    def removePictureFolder(self,student_id):
     694        """remove picture_folder by renaming it"""
     695        path = 'images'
     696        picture_path = os.path.join(i_home,path,student_id)
     697        if not os.path.exists(picture_path):
     698            return False
     699        os.rename(picture_path,picture_path + "_removed")
     700        return True
     701    ###)
     702
     703    security.declareProtected(ModifyPortalContent,'restorePictureFolder') ###(
     704    def restorePictureFolder(self,student_id):
     705        """restore picture_folder by renaming it"""
     706        path = 'images'
     707        picture_path = os.path.join(i_home,path,student_id)
     708        if not os.path.exists(picture_path + "_removed"):
     709            return False
     710        os.rename(picture_path + "_removed",picture_path)
     711        return True
     712    ###)
     713
    692714    security.declarePublic('picturesExist') ###(
    693715    def picturesExist(self, ids):
Note: See TracChangeset for help on using the changeset viewer.