Changeset 3812 for WAeUP_SRP/trunk


Ignore:
Timestamp:
11 Dec 2008, 07:24:16 (16 years ago)
Author:
Henrik Bettermann
Message:

resolve Uniben #589

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r3807 r3812  
    380380    def generateStudentId(self,letter): ###(
    381381        import random
     382        logger = logging.getLogger('WAeUPTool.generateStudentId')
    382383        r = random
    383         ##if letter not in ('ABCDEFGIHKLMNOPQRSTUVWXY'):
    384384        if letter == '?':
    385385            letter= r.choice('ABCDEFGHKLMNPQRSTUVWXY')
    386386        sid = "%c%d" % (letter,r.randint(99999,1000000))
    387387        students = self.portal_url.getPortalObject().campus.students
    388         # while hasattr(students, sid):
    389         #     sid = "%c%d" % (letter,r.randint(99999,1000000))
    390         while self.students_catalog(id = sid):
     388        while self.students_catalog(id = sid) or self.waeup_tool.picturePathExists(sid):
     389            if self.waeup_tool.picturePathExists(sid):
     390                logger.info('picture path %s exists' % sid)
    391391            sid = "%c%d" % (letter,r.randint(99999,1000000))
    392392        return sid
     
    12631263        pictures  = [picture[:picture.rfind('_')] for picture in os.listdir(picture_path)]
    12641264        return set(ids).issubset(set(pictures))
     1265    ###)
     1266   
     1267        security.declarePublic('picturePathExists') ###(
     1268    def picturePathExists(self, student_id=None):
     1269        """check if picture path exists in the filesystem"""
     1270        if student_id is None:
     1271            student_id = self.getStudentId()
     1272        if student_id is None:
     1273            return False
     1274        picture_path = getImagesDir(student_id)
     1275        if os.path.exists(picture_path):
     1276            return True
     1277        return False
    12651278    ###)
    12661279   
  • WAeUP_SRP/trunk/skins/waeup_fceoyo/getSchoolFee.py

    r3761 r3812  
    1414
    1515
    16 ARTS = ('CRS','ISS','MUS','SOS','THA','PES')
     16ARTS = ('CRS','ISS','MUS','SOS','THA','PES','ECO','GEO')
    1717
    1818# SCS = ('BIO','HEC','MAT','ARB','ISC','IGB','YOR','HAU','ENG ','FRE','PHY ','CSC','PHE','AGE','FAA','BED','HEC')
Note: See TracChangeset for help on using the changeset viewer.