Changeset 998 for WAeUP_SRP/trunk


Ignore:
Timestamp:
6 Dec 2006, 08:07:36 (18 years ago)
Author:
joachim
Message:

=faster logged in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r990 r998  
    4949        if "Student" in member.getRoles():
    5050            to_waeup_student_home = True
    51             info = context.getStudentInfo()
    52             student = info['student']
    53             if info['review_state'] in ("student_created","admitted") and\
    54             wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
     51            #info = context.getStudentInfo()
     52            #student = info['student']
     53            students = context.portal_url.getPortalObject().campus.students
     54            student = getattr(students,str(member))
     55            student_app = getattr(student,'application')
     56            student_pume = getattr(student,'pume',None)
     57            s_review_state = wftool.getInfoFor(student,'review_state',None)
     58            a_review_state = wftool.getInfoFor(student_app,'review_state',None)
     59            #if info['review_state'] in ("student_created","admitted") and\
     60            #wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
     61            if s_review_state in ("student_created","admitted") and\
     62            a_review_state == 'created' :
    5563                #student.content_status_modify(workflow_action="enter_clearance_pin")
    56                 wftool.doActionFor(info['app'],'open')
     64                #wftool.doActionFor(info['app'],'open')
     65                wftool.doActionFor(student_app,'open')
    5766                #wftool.doActionFor(info['pume'],'close')
    58                 if info['pume'] is not None:
    59                   wftool.doActionFor(info['pume'],'close')
     67                #if info['pume'] is not None:
     68                if student_pume is not None:
     69                  #wftool.doActionFor(info['pume'],'close')
     70                  wftool.doActionFor(student_pume,'close')
    6071                da = {}
    6172                pin = request.get('pin')
     73                app_doc = student_app.getContent()
    6274                if not pin:
    63                     jamb_reg_no = info['app_doc'].jamb_reg_no
     75                    app_doc = student_app.getContent()
     76                    jamb_reg_no = app_doc.jamb_reg_no
    6477                    res = context.portal_pins(student=jamb_reg_no)
    6578                    if len(res) == 1:
    6679                        p = res[0].pin
    67                         pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
     80                        if len(p) > 10:
     81                            pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
     82                        else:
     83                            pin = p
    6884##                email = request.get('email')
    69                 app_doc = info['app_doc']
     85                #app_doc = info['app_doc']
    7086                da['app_ac_pin'] = pin
    7187##                da['app_email'] = email
     
    98114if to_waeup_student_home:
    99115    #member.setProperties(last_login_time=current,login_time=current)
    100     if info['review_state'] == "application_pin_entered":
     116    #if info['review_state'] == "application_pin_entered":
     117    if s_review_state == "application_pin_entered":
    101118        return response.redirect("%s/application_edit" % student.absolute_url())
    102     elif info['review_state'] == "admitted":
     119    #elif info['review_state'] == "admitted":
     120    elif s_review_state == "admitted":
    103121        return response.redirect("%s/admission_form" % student.absolute_url())
    104     elif info['review_state'] == "clearance_pin_entered":
     122    #elif info['review_state'] == "clearance_pin_entered":
     123    elif s_review_state == "clearance_pin_entered":
    105124        return response.redirect("%s/clearance_edit" % student.absolute_url())
    106     return response.redirect("%s/student_index" % info['url'])
     125    return response.redirect("%s/student_index" % student.absolute_url())
    107126
    108127elif to_member_home:
Note: See TracChangeset for help on using the changeset viewer.