Ignore:
Timestamp:
15 Oct 2007, 12:04:52 (17 years ago)
Author:
joachim
Message:

new function picturesExist in waeup_tool used in clearance_edit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_student/clearance_edit.py

    r2013 r2363  
    4949                  )
    5050required_scans = ('fst_sit_scan',
     51                  'age_dec',
     52                  'birth_certificate',
    5153#                 'jamb_slip',
    5254                  'ref_let',
     
    9698        logger.info('%s edited clearance object of %s' % (member_id,student_id ))
    9799
    98         ## No idea why the following lines were still active until July 6.
    99         ## The code does not make any sense. When editing the clearance object
    100         ## as admin, always the PIN HOS-1-4921190317
    101         ## was filled in. This was the only PIN ever used by admin.
    102        
    103         #if clear_doc.clr_ac_pin == "":
    104         #    res = context.portal_pins(student=member_id)
    105         #    if res:
    106         #        p = res[0].pin
    107         #        if len(p) > 10:
    108         #            pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
    109         #        else:
    110         #            pin = p
    111         #        clear_doc.edit(mapping={'clr_ac_pin': pin})
    112 
    113         ## simple method to remove the wrong PIN
    114        
    115         #if clear_doc.clr_ac_pin.startswith('HOS'):
    116         #    pin=''
    117         #    clear_doc.edit(mapping={'clr_ac_pin': pin})
    118 
    119 
    120100    elif cpsdocument_edit_and_view_button:
    121101        if acknowledge and info['review_state'] == "clearance_pin_entered":
    122102            missing = False
    123             files = clear_doc.objectIds()
    124             for scan in required_scans:
    125                 if scan not in files:
    126                     missing = True
    127                     break
    128             if not missing:
    129                 if not "age_dec" in files and not "birth_certificate" in files:
    130                     missing = True
    131             if missing:
     103            #files = clear_doc.objectIds()
     104            # for scan in required_scans:
     105            #     if scan not in files:
     106            #         missing = True
     107            #         break
     108            # if not missing:
     109            #     if not "age_dec" in files and not "birth_certificate" in files:
     110            #         missing = True
     111            if not context.waeup_tool.picturesExist(required_scans):
    132112                logger.info('%s requested clearance with documents missing' % (student_id))
    133113                psm = "You have not uploaded all necessary documents to request clearance!"
Note: See TracChangeset for help on using the changeset viewer.