Ignore:
Timestamp:
11 Sep 2006, 10:39:59 (18 years ago)
Author:
joachim
Message:

Scratchcard Pin Generation
basic login in apply_admission

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py

    r488 r502  
    77import DateTime
    88current = DateTime.DateTime()
     9pr = context.portal_registration
    910
    1011
     
    2526                      layout_mode='create',
    2627                      formaction = "apply_admission",
    27                       submit = "check",
     28                      button = "Open JAMB Record",
    2829                      )
    2930if psm == 'invalid':
     
    4344                                 )
    4445elif psm == 'valid':
    45     jamb_id = ds.get('jamb_reg_no')
    46     student = context.getContent().getStudentByRegNo(jamb_id)
    47     if student is None:
    48         psm = "JAMB record %s not accessible." % (jamb_id)
    49         return context.application_pin_form(rendered = res,
    50                                  psm = psm,
    51                                  #psm = "%s, %s" % (psm,ds),
    52                                  ds = ds,
    53                                  )
    54 application = student.application
    55 if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
    56     #student.invokeFactory('StudentClearance','clearance')
    57     student.invokeFactory('StudentPersonal','personal')
    58     student.content_status_modify(workflow_action="enter_application_pin")
     46    s_id = ds.get('s_id')
     47    return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
     48          % (context.absolute_url(),s_id,'uNsEt',ds.get('app_ac_pin')))
     49   
     50##    jamb_id = ds.get('jamb_reg_no')
     51##    student = context.getContent().getStudentByRegNo(jamb_id)
     52##    if student is None:
     53##        psm = "JAMB record %s not accessible." % (jamb_id)
     54##        return context.application_pin_form(rendered = res,
     55##                                 psm = psm,
     56##                                 #psm = "%s, %s" % (psm,ds),
     57##                                 ds = ds,
     58##                                 )
     59##if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
     60##    #student.invokeFactory('StudentClearance','clearance')
     61##da = {}
     62##pin = str(ds.get('app_ac_pin'))
     63##da['app_ac_pin'] = pin
     64##da['app_ac_date'] = current
     65##apdoc.edit(mapping = da)
    5966
    6067
    61 apdoc = application.getContent()
    62 names = apdoc.jamb_lastname.split()
    63 dp = {}
    64 if len(names) == 3:
    65     dp['firstname'] = names[0].capitalize()
    66     dp['middlename'] = names[1].capitalize()
    67     dp['lastname'] = names[2].capitalize()
    68 elif len(names) == 2:
    69     dp['firstname'] = names[0].capitalize()
    70     dp['lastname'] = names[1].capitalize()
    71 else:
    72     dp['lastname'] = apdoc.jamb_lastname
    73 dp['sex'] = apdoc.jamb_sex == 'F'
    74 dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
    75 student.personal.getContent().edit(mapping = dp)
    76 da = {}
    77 da['app_ac_pin'] = ds.get('app_ac_pin')
    78 da['app_ac_date'] = current
    79 apdoc.edit(mapping = da)
    8068# now display the passport form with jamb-data readonly
    8169return context.REQUEST.RESPONSE.redirect("%s/application_form" % (student.application.absolute_url()))
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r493 r502  
    8181         class="standalone"
    8282         name="cpsdocument_create_button"
    83          value="apply"
    84          i18n:attributes="value" tal:condition="creation" />
     83         value="apply"
     84         tal:attributes="value options/button"
     85         tal:condition="creation" />
    8586
    8687</form>
    87 
    88                          
    8988</metal:block>
    9089
Note: See TracChangeset for help on using the changeset viewer.