Ignore:
Timestamp:
17 Nov 2007, 20:11:55 (17 years ago)
Author:
Henrik Bettermann
Message:

edit applicant record only if status not 'created'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2695 r2699  
    9999        wf_def.updateRoleMappingsFor(ob)
    100100    ###)
    101    
     101
    102102    security.declareProtected(ModifyPortalContent,'openLog') ###(
    103103    def openLog(self,name):
     
    13991399        #import pdb;pdb.set_trace()
    14001400        reg_no = mapping.get('reg_no')
    1401         try:
    1402             self.applicants_catalog.modifyRecord(**mapping)
    1403         except KeyError:
     1401        res = self.applicants_catalog(reg_no = reg_no)
     1402        if len(res):
     1403            if res[0].status == 'created':
     1404                return '', "student object with id %s for %s already created, status not changed" % (res[0].student_id, reg_no)
     1405            else:
     1406                self.applicants_catalog.modifyRecord(**mapping)
     1407                return reg_no,''
     1408        else:
    14041409            return '', "applicant record with reg_no %s does not exist" % reg_no
    1405         return reg_no,''
     1410       
    14061411    ###)
    14071412
Note: See TracChangeset for help on using the changeset viewer.