Changeset 2420


Ignore:
Timestamp:
22 Oct 2007, 20:46:57 (17 years ago)
Author:
joachim
Message:

use waeup_tool.picturesExist for passport check

Location:
WAeUP_SRP/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2413 r2420  
    393393    ###)
    394394
    395     security.declarePublic('loadStudentFoto') ###(
    396     def old____loadStudentFoto(self,student,filename,folder):
     395    def old____loadStudentFoto(self,student,filename,folder): ###(
    397396        "return a student passport picture"
    398397        app = student.application
     
    735734
    736735    security.declarePublic('picturesExist') ###(
    737     def picturesExist(self, ids):
     736    def picturesExist(self, ids,student_id=None):
    738737        """check if pictures exist in the filesystem"""
    739         path = 'images'
    740         student_id = self.getStudentId()
    741         picture_path = os.path.join(i_home,path,student_id)
     738        if student_id is None:
     739            student_id = self.getStudentId()
     740        if student_id is None:
     741            return False
     742        picture_path = os.path.join(images_base,student_id)
    742743        if not os.path.exists(picture_path):
    743744            return False
  • WAeUP_SRP/base/skins/cps_custom/logged_in.py

    r2412 r2420  
    114114        # look for passport pictures of returning students
    115115
    116         if s_review_state == 'returning' and 'passport' not in app_doc.objectIds():
     116        #if s_review_state == 'returning' and 'passport' not in app_doc.objectIds():
     117        # use new test
     118        if s_review_state == 'returning' and\
     119           not context.waeup_tool.picturesExist(('passport',), student.getId()):
    117120            folder = 'pictures_returning'
    118121            res = context.students_catalog(id = str(member))
     
    126129        # look for passport pictures of new students
    127130
    128         if s_review_state in ('admitted', 'clearance_pin_entered', 'clearance_requested')  and 'passport' not in app_doc.objectIds():
     131        if s_review_state in ('admitted',
     132                              'clearance_pin_entered',
     133                              'clearance_requested'
     134                             )  and not context.waeup_tool.picturesExist(('passport',),
     135                                                                         student.getId()):
    129136            folder = 'pictures_admitted_latest'
    130137            filename = app_doc.jamb_reg_no.replace('/','_')
Note: See TracChangeset for help on using the changeset viewer.