Changeset 2593 for WAeUP_SRP/base


Ignore:
Timestamp:
8 Nov 2007, 14:50:21 (17 years ago)
Author:
joachim
Message:

add re_use_pin flag to ScratchcardPinWidget?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Widgets.py

    r2557 r2593  
    11391139         {'id': 'reference', 'type': 'string', 'mode': 'w',
    11401140         'label': 'Reference Field'},
     1141         {'id': 're_use_pin', 'type': 'boolean', 'mode': 'w',
     1142         'label': 'Reuse Application Pin'},
    11411143        )
    11421144    prefix = ''
    11431145    reference = ''
     1146    re_use_pin = True
     1147   
    11441148    def prepare(self, datastructure, **kw): ###(
    11451149        """Prepare datastructure from datamodel."""
     
    12111215                datastructure.setError(widget_id, 'PIN neither checked nor used.')
    12121216                s_logger.info('%s/%s entered wrong data together with PIN %s' % (s_id,ref,pin_str))
     1217        if prefix == 'APP' and not self.re_use_pin:
     1218            res =  self.applicants_catalog(reg_no = ref)
     1219            if res and res[0].pin == pin_str:
     1220                do = 0
     1221                err = 'Application PIN cannot be reused'
     1222                s_logger.info('%s entered same PIN as for Application %s' % (s_id,pin_str))
     1223               
    12131224        while do:
    12141225            ok = pins.searchAndSetRecord(pin,ref,prefix)
Note: See TracChangeset for help on using the changeset viewer.