Changeset 2353


Ignore:
Timestamp:
12 Oct 2007, 10:47:41 (17 years ago)
Author:
Henrik Bettermann
Message:

ensure that always correct application form is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Widgets.py

    r2352 r2353  
    13611361        datastructure[widget_id+'_b'] = b
    13621362        datastructure[widget_id+'_n'] = n
    1363         if self.REQUEST.traverse_subpath:
    1364             screening_type = self.REQUEST.traverse_subpath[0]
    1365         else:
    1366             screening_type = 'manage'
    1367         datastructure["screening_type"] = screening_type
    1368         #import pdb;pdb.set_trace()
    13691363    ###)
    13701364
    13711365    def validate(self, datastructure, **kw): ###(
    13721366        """Validate datastructure and update datamodel."""
     1367        #import pdb;pdb.set_trace()
    13731368        s_logger = logging.getLogger('Widgets.ScratchcardPinWidget.validate')
    13741369        widget_id = self.getWidgetId()
     
    14301425            if ok >= 1:
    14311426                #screening_type = self.REQUEST.form.get('screening_type','unknown')
    1432                 screening_type = datastructure['screening_type']
     1427                #screening_type = datastructure['screening_type']               
     1428               
     1429                if self.REQUEST.traverse_subpath:
     1430                    screening_type_request = self.REQUEST.traverse_subpath[0]
     1431                else:
     1432                    screening_type_request = 'manage'
    14331433                if self.isStudent():
    14341434                    err = "You are a student!"
     
    14381438                    applicant = datastructure['record']
    14391439                   
    1440                     if applicant.screening_type != screening_type and screening_type != 'manage':
    1441                         err = "Wrong application form!"
     1440                    if applicant.screening_type != screening_type_request and screening_type_request != 'manage':
     1441                        err = "You used the wrong application form!"
    14421442                        s_logger.info('%s tried to use %s application form but has applied for %s' % (ref,
    1443                                                                                            screening_type,
     1443                                                                                           screening_type_request,
    14441444                                                                                           applicant.screening_type))
    14451445                        break
     
    14491449                        d['reg_no'] = applicant.reg_no
    14501450                        d['pin'] = pin_str
    1451                         d['screening_type'] = screening_type
     1451                        #d['screening_type'] = screening_type
    14521452                        d['status'] = 'entered'
    14531453                        getattr(self,self.catalog).modifyRecord(**d)
     
    14651465                        d['pin'] = pin_str
    14661466                        d['status'] = 'entered'
    1467                         d['screening_type'] = screening_type
     1467                        d['screening_type'] = screening_type_request
    14681468                        self.applicants_catalog.addRecord(**d)
    14691469                    else:
Note: See TracChangeset for help on using the changeset viewer.