Changeset 2731


Ignore:
Timestamp:
21 Nov 2007, 15:51:43 (17 years ago)
Author:
Henrik Bettermann
Message:

overwrite application records even if objects have already been created

The new and old states must be 'created', otherwise editing is been rejected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2727 r2731  
    14161416        #import pdb;pdb.set_trace()
    14171417        reg_no = mapping.get('reg_no')
     1418        status = mapping.get('status')
    14181419        res = self.applicants_catalog(reg_no = reg_no)
    14191420        if len(res):
    1420             if res[0].status == 'created':
    1421                 return '', "student object with id %s for %s already created, status not changed" % (res[0].student_id, reg_no)
     1421            if res[0].status == 'created' and status != 'created':
     1422                return '', "student object with id %s for %s already created, status cannot be changed" % (res[0].student_id, reg_no)
     1423            elif status == 'created' and res[0].status != 'created':
     1424                return '', "student object for %s has not yet been created, status cannot be set to 'created'" % (reg_no)
    14221425            else:
    14231426                self.applicants_catalog.modifyRecord(**mapping)
Note: See TracChangeset for help on using the changeset viewer.