Changeset 1793
- Timestamp:
- 17 May 2007, 07:11:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r1783 r1793 127 127 c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})] 128 128 if hasattr(self.aq_parent,value): 129 err = ' course %s already exists' % (value)129 err = 'Course %s already exists' % (value) 130 130 elif value not in c_ids: 131 err = ' course %s does not exist' % (value)131 err = 'Course %s does not exist' % (value) 132 132 if err: 133 133 datastructure.setError(widget_id, err) … … 159 159 res = self.portal_catalog(meta_type= "Course",id = value) 160 160 if len(res) > 0: 161 err = ' course %s already exists' % (value)161 err = 'Course %s already exists' % (value) 162 162 if err: 163 163 datastructure.setError(widget_id, err) … … 305 305 if not valid: #or not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()): 306 306 #err = 'Invalid number, the expected format is: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str) 307 err = ' invalid number'307 err = 'Invalid number' 308 308 elif self.reference == '': 309 309 #s = getStudentByRegNo(self,value) 310 310 pume = jamb_nr_catalog(jamb_reg_no = value) 311 311 if len(pume) < 1: 312 err = ' no Student with JAMB RegNo%s' % (value)312 err = 'No student with Registration Number %s' % (value) 313 313 else: 314 314 datastructure['pume'] = pume[0] … … 354 354 #import pdb;pdb.set_trace() 355 355 if not valid or len(value) < 2: 356 err = ' invalid string'356 err = 'Invalid string' 357 357 elif not record or datastructure.errors: 358 358 err = 0 … … 443 443 value = datastructure[widget_id] 444 444 if not valid or not value: 445 err = ' invalid string %s' % value445 err = 'Invalid string %s' % value 446 446 logger.info('Invalid matric_no string %s' % value) 447 447 else: … … 452 452 if len(res) < 1: 453 453 logger.info('matric_no %s not found' % value) 454 err = ' no student with matric_no%s' % (value)454 err = 'No student with Matriculation Number %s' % (value) 455 455 break 456 456 datastructure['student'] = res[0] … … 458 458 res = results(matric_no = value) 459 459 if len(res) < 1: 460 err = ' no results with matric_no%s' % (value)460 err = 'No results for Matriculation Number %s' % (value) 461 461 continue 462 462 datastructure['results'] = res … … 487 487 value = datastructure[widget_id] 488 488 if not valid or not value: 489 err = ' invalid Id string %s' % value489 err = 'Invalid Id string %s' % value 490 490 logger.info('Invalid id string %s' % value) 491 491 datastructure['student'] = None … … 495 495 if not res: 496 496 logger.info('Student id %s not found' % value) 497 err = ' no student with Id %s' % (value)497 err = 'No student with Id %s' % (value) 498 498 datastructure['student'] = None 499 499 else: … … 632 632 while 1: 633 633 if not s and g: 634 err = " no subject grade for subject %s " % s634 err = "No subject grade for subject %s " % s 635 635 break 636 636 i = 0 … … 773 773 elif len(n) != 10: 774 774 do = 0 775 err = ' invalid PIN length %d' % len(n)775 err = 'Invalid PIN length %d' % len(n) 776 776 s_logger.info('%s entered invalid PIN with length %d' % (s_id,len(n))) 777 777 elif self.reference == "": … … 794 794 break 795 795 elif ok == -1: 796 err = ' invalid PIN'796 err = 'Invalid PIN' 797 797 s_logger.info('%s/%s entered invalid PIN %s' % (s_id,ref,pin_str)) 798 798 break … … 817 817 s_logger.info('%s/%s successfully used PIN %s' % (s_id,ref,pin_str)) 818 818 if student is None: 819 err = " student not found"819 err = "Student not found" 820 820 s_logger.info('%s not found in admission list' % (ref)) 821 821 break … … 830 830 s_logger.info('%s/%s (non-member) repeatedly checked admission with PIN %s' % (s_id,ref,pin_str)) 831 831 else: 832 err = " unknown error" % s_id832 err = "Unknown error" % s_id 833 833 s_logger.info('%s/%s repeatedly activated service with PIN %s' % (s_id,ref,pin_str)) 834 834 break
Note: See TracChangeset for help on using the changeset viewer.