Changeset 1030 for WAeUP_SRP/trunk
- Timestamp:
- 11 Dec 2006, 18:12:23 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r997 r1030 130 130 131 131 class PinTable(WAeUPTable): 132 132 from ZODB.POSException import ConflictError 133 133 meta_type = 'WAeUP Pin Tool' 134 134 name = "pins" … … 136 136 def __init__(self): 137 137 WAeUPTable.__init__(self, 'portal_pins') 138 139 138 139 140 140 def searchAndSetRecord(self, uid, student_id,prefix): 141 141 #records = self.searchResults(uid=uid) … … 159 159 # Add the updated data: 160 160 record_data['student'] = student_id 161 self.catalog_object(dict2ob(record_data), uid) 162 return 1 161 try: 162 self.catalog_object(dict2ob(record_data), uid) 163 return 1 164 except ConflictError: 165 return 2 163 166 if record.student.upper() != student_id.upper(): 164 167 return 0 -
WAeUP_SRP/trunk/Widgets.py
r1025 r1030 506 506 s_id = str(self.portal_membership.getAuthenticatedMember()) 507 507 if self.reference == "": 508 ref = s_id 508 ref = s_id 509 509 else: 510 510 ref = datastructure[self.reference] … … 512 512 do = 0 513 513 datastructure.setError(widget_id, 'Errors in other data, PIN neither checked nor used.') 514 s_logger.info('"%s", "%s","entered wrong data together with pin", "%s"' % (s_id,ref,pin)) 514 515 while do: 515 516 ok = pins.searchAndSetRecord(pin,ref,prefix) 516 if ok == -2: 517 if ok < -2 or ok > 2: 518 err = 'Unknown error, please report!' 519 s_logger.info('"%s","%s", "caused unknown error with pin", "%s"' % (s_id,ref,pin)) 520 break 521 elif ok == -2: 517 522 err = 'Service already activated but with a different PIN.' 523 s_logger.info('"%s","%s", "repeatedly activated service but with different pin", "%s"' % (s_id,ref,pin)) 518 524 break 519 525 elif ok == -1: 520 526 err = 'Invalid PIN' 521 break 522 elif ok == -3: 523 err = 'Unknown error, please report!' 527 s_logger.info('"%s","%s", "entered invalid pin", "%s"' % (s_id,ref,pin)) 524 528 break 525 529 if ok == 0: 526 530 err = 'PIN already used.' 531 s_logger.info('"%s","%s", "entered used pin", "%s"' % (s_id,ref,pin)) 527 532 break 528 533 if ok >= 1: … … 531 536 if self.reference == "jamb_reg_no": 532 537 err = "You are already logged in." 533 s_logger.info('"%s", "logged in with pin", "%s"' % (ref,pin))538 s_logger.info('"%s","%s", "checked admission though logged in", "%s"' % (s_id,ref,pin)) 534 539 break 535 s_logger.info('"%s", "used pin", "%s"' % (ref,pin)) #bitte genauer beschreiben540 s_logger.info('"%s","%s", "successfully used pin", "%s"' % (s_id,ref,pin)) 536 541 break 537 542 else: 538 543 student = getStudentByRegNo(self,ref) 539 s_logger.info('" jamb_reg_no:%s","used","%s"' % (ref,pin)) #bitte genauer beschreiben544 s_logger.info('"%s","%s","successfully used pin","%s"' % (s_id,ref,pin)) 540 545 if student is None: 541 546 err = "Student not found." 547 s_logger.info('"%s","not found in admission list"' % (ref)) 542 548 break 543 549 s_id = student.getId() … … 546 552 if hasattr(self.portal_directories.students,s_id): 547 553 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 548 s_logger.info('"%s", "repeatedly checked admission with pin", "%s"' % (s_id,pin)) #ist das richtig?554 s_logger.info('"%s","%s", "repeatedly checked admission with pin", "%s"' % (s_id,ref,pin)) 549 555 break 550 556 else: 551 s_logger.info('"%s"," (non-member) repeatedly checked admission with pin", "%s"' % (s_id,pin)) #ist das richtig?557 s_logger.info('"%s","%s","(non-member) repeatedly checked admission with pin", "%s"' % (s_id,ref,pin)) 552 558 else: 553 err = " Please login with your Student Id %s and 10-digit PIN." % s_id554 s_logger.info('"%s", "repeatedly checked admission with pin", "%s"' % (s_id,pin)) #ist das richtig?559 err = "Unknown error" % s_id 560 s_logger.info('"%s","%s", "repeatedly activated service with pin", "%s"' % (s_id,ref,pin)) 555 561 break 556 ## if self.reference == "jamb_reg_no":557 ## res = self.students_catalog(jamb_reg_no = ref)558 ## if len(res) > 0:559 ## err = "Please login with your Student Id %s and 10-digit PIN." % s_id560 ## s_logger.info("Student %s double checked Admission Pin %s" % (s_id,pin))561 ## break562 562 try: 563 563 student.getContent().makeStudentMember(s_id,password=pin[4:]) 564 s_logger.info('"%s", "has been created using pin", "%s"' % (s_id,pin))564 s_logger.info('"%s","%s", "has been created using pin", "%s"' % (s_id,ref,pin)) 565 565 except: 566 566 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 567 s_logger.info('"%s", "has been repeatedly created usin pin", "%s"' % (s_id,ref)) #????? bitte genauer beschreiben567 s_logger.info('"%s","%s", "could not be made a member with pin", "%s"' % (s_id,ref,pin)) 568 568 break 569 569 break -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt
r1014 r1030 1 1 <metal:block define-macro="clearance_edit_form"> 2 <metal:block tal:define="info context/getStudentInfo"> 3 <span tal:condition="not: info"> 4 <metal:block use-macro="here/error_not_found/macros/not_found" /> 5 </span> 6 <metal:block tal:condition="info"> 2 7 <tal:block define=" 3 info context/getStudentInfo;4 8 is_so context/isSectionOfficer; 5 9 is_staff context/isStaff; … … 46 50 </tal:block> 47 51 </metal:block> 52 </metal:block> 53 </metal:block> -
WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt
r1006 r1030 35 35 36 36 <span tal:replace="structure rendered" /> 37 <tal:block tal:condition="python: batch_info and batch_info['nb_pages'] > 1">37 <tal:block tal:condition="python: items and batch_info and batch_info['nb_pages'] > 1"> 38 38 <div class="batchLayout"> 39 39 <span i18n:translate=""> -
WAeUP_SRP/trunk/skins/waeup_student/start_clearance.py
r1027 r1030 23 23 app_doc = info['app_doc'] 24 24 review_state = info['review_state'] 25 25 session = REQUEST.SESSION 26 26 res,psm,ds = lt.renderLayout(layout_id='student_clearance', 27 27 schema_id= 'student_clearance', … … 41 41 ) 42 42 error = False 43 if app_doc.passport is None: 43 if session.get("clicked",None): 44 psm = 'Please wait a moment, until "Clearance started" turns green, then click on the green link' 45 error = True 46 elif app_doc.passport is None: 44 47 psm = "You must upload your passport picture before you can start the registration process!" 45 48 error = True … … 57 60 ds = ds, 58 61 ) 62 session.set("clicked","clicked") 59 63 pin = str(ds.get('clr_ac_pin')) 60 64 logger.info('"%s", "entered clearance pin", "%s"' % (info['id'],pin)) -
WAeUP_SRP/trunk/skins/waeup_student/students_index.py
r937 r1030 24 24 25 25 if "ClearanceOfficers" in member.getGroups(): 26 return redirect("%s/search_students" % students_url) 26 return context.waeup_tool.searchStudents() 27 #return redirect("%s/search_students" % students_url) 27 28 if context.isSectionOfficer(): 28 29 return redirect("%s/search_students" % students_url)
Note: See TracChangeset for help on using the changeset viewer.