Ignore:
Timestamp:
16 Jun 2007, 14:09:52 (17 years ago)
Author:
joachim
Message:

error messages with variables cause no modifications to zodb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r1891 r1907  
    510510            value = datastructure[widget_id].upper()
    511511            err = 0
     512            mapping = {}
    512513            if len(value.split()) > 1:
    513514                err = 'Invalid Id, Id contains space(s).'
    514515            elif self.portal_catalog(portal_type=portal_type_query,id=value):
    515516                brain = self.portal_catalog(portal_type=portal_type_query,id=value)[0]
    516                 err = 'An %s object with the Id %s already exists at %s.'\
    517                       % (brain.portal_type,value,brain.getPath())
     517                err = 'An ${portal_type} object with the Id ${id} already exists at ${path}.'
     518                mapping = {'portal_type': brain.portal_type,
     519                           'id': value,
     520                           'path': brain.getPath(),
     521                           }
    518522            if err:
    519                 datastructure.setError(widget_id, err)
     523                datastructure.setError(widget_id, err, mapping)
    520524            else:
    521525                datamodel = datastructure.getDataModel()
     
    10321036        #import pdb;pdb.set_trace()
    10331037        err = 0
     1038        mapping = {}
    10341039        prefix= self.prefix
    10351040        if prefix.startswith('@'):
     
    11081113                    if self.reference == "jamb_reg_no":
    11091114                        if hasattr(self.portal_directories.students,s_id):
    1110                             err = "Please login with your Student Id %s and 10-digit PIN." % s_id
     1115                            err = "Please login with your Student Id ${id} and 10-digit PIN."
     1116                            mapping = {'id': s_id}
    11111117                            s_logger.info('%s/%s repeatedly checked admission with PIN %s' % (s_id,ref,pin_str))
    11121118                            break
     
    11211127                    s_logger.info('%s/%s has been created using PIN %s' % (s_id,ref,pin_str))
    11221128                except:
    1123                     err = "Please login with your Student Id %s and 10-digit PIN." % s_id
     1129                    err = "Please login with your Student Id ${id} and 10-digit PIN."
     1130                    mapping = {'id': s_id}
    11241131                    s_logger.info('%s/%s could not be made a member with PIN %s' % (s_id,ref,pin_str))
    11251132                    break
    11261133            break
    11271134        if err:
    1128             datastructure.setError(widget_id, err)
     1135            datastructure.setError(widget_id, err,mapping)
    11291136        else:
    11301137            datamodel = datastructure.getDataModel()
Note: See TracChangeset for help on using the changeset viewer.