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

Scratchcard Pin Generation
basic login in apply_admission

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/process_waeup_login.py

    r472 r502  
    77request = context.REQUEST
    88response=request.response
    9 return
    10 ##
    11 ##if request.form.get('submit') == 'Login':
    12 ##    #waeup = context.portal_catalog(id = 'demouni')[0]
    13 ##    #waeup = context.portal_catalog(portal_type = 'University')[0]
    14 ##    if 1 or "Manager" in member.getRoles():
    15 ##        return
    16 ###return
    17 ##member_id = str(member)
     9import DateTime
     10current = DateTime.DateTime()
     11#
     12if request.form.get('submit') == 'Login':
     13    if "Manager" in member.getRoles():
     14        return
     15member_id = str(member)
     16student = getattr(context.students,member_id)
     17application = student.application
     18#student.invokeFactory('StudentPersonal','personal')
     19apdoc = application.getContent()
     20names = apdoc.jamb_lastname.split()
     21dp = {}
     22if len(names) == 3:
     23    dp['firstname'] = names[0].capitalize()
     24    dp['middlename'] = names[1].capitalize()
     25    dp['lastname'] = names[2].capitalize()
     26elif len(names) == 2:
     27    dp['firstname'] = names[0].capitalize()
     28    dp['lastname'] = names[1].capitalize()
     29else:
     30    dp['lastname'] = apdoc.jamb_lastname
     31    dp['sex'] = apdoc.jamb_sex == 'F'
     32    dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
     33student.personal.getContent().edit(mapping = dp)
     34##student.content_status_modify(workflow_action="enter_application_pin")
     35
     36da = {}
     37da['app_ac_pin'] = request.get('pin')
     38da['app_ac_date'] = current
     39apdoc.edit(mapping = da)
     40
     41return response.redirect("%s/application_form" % student.application.absolute_url())
     42
    1843##ma = getattr(context,member_id)
    1944##jkw = {'application_sc_pin': sc_pin}
     
    5378##context.notifyCPSDocumentCreation(ob=pd)
    5479##
    55 ##return response.redirect("%s" % ma.absolute_url())
    5680###return ma.personal_addon(REQUEST=context.REQUEST)
    5781
Note: See TracChangeset for help on using the changeset viewer.