Changeset 996


Ignore:
Timestamp:
5 Dec 2006, 19:28:18 (18 years ago)
Author:
joachim
Message:

=fix pin-formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r995 r996  
    403403        if not batch_no and not number:
    404404            s = prefix
    405             if len(s) > 5:
     405            if len(s) > 3:
    406406                prefix,batch_no,number = s[:3],s[3:-10],s[-10:]
    407407            else:
    408                 prefix,batch_no,number = '','',s
     408                prefix,batch_no,number = s,'',''
    409409        self.p = prefix
    410410        self.b = batch_no
     
    458458    def validate(self, datastructure, **kw):
    459459        """Validate datastructure and update datamodel."""
    460         #import pdb;pdb.set_trace()
    461460        s_logger = logging.getLogger('students_pin_usage')
    462461        widget_id = self.getWidgetId()
    463462        v = datastructure[widget_id]
     463        #import pdb;pdb.set_trace()
    464464        err = 0
    465465        prefix= self.prefix
     
    562562                v = ScratchCardPin(p,b,n)
    563563            except ValueError:
    564                 v = ScratchCardPin(v,'','')
     564                v = ScratchCardPin(self.prefix,'1',v)
     565                pass
    565566        if v:
    566567            prefix= '%s' % v.p
Note: See TracChangeset for help on using the changeset viewer.