Index: /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 997)
+++ /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 998)
@@ -49,23 +49,39 @@
         if "Student" in member.getRoles():
             to_waeup_student_home = True
-            info = context.getStudentInfo()
-            student = info['student']
-            if info['review_state'] in ("student_created","admitted") and\
-            wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
+            #info = context.getStudentInfo()
+            #student = info['student']
+            students = context.portal_url.getPortalObject().campus.students
+            student = getattr(students,str(member))
+            student_app = getattr(student,'application')
+            student_pume = getattr(student,'pume',None)
+            s_review_state = wftool.getInfoFor(student,'review_state',None)
+            a_review_state = wftool.getInfoFor(student_app,'review_state',None)
+            #if info['review_state'] in ("student_created","admitted") and\
+            #wftool.getInfoFor(info['app'],'review_state',None) == 'created' :
+            if s_review_state in ("student_created","admitted") and\
+            a_review_state == 'created' :
                 #student.content_status_modify(workflow_action="enter_clearance_pin")
-                wftool.doActionFor(info['app'],'open')
+                #wftool.doActionFor(info['app'],'open')
+                wftool.doActionFor(student_app,'open')
                 #wftool.doActionFor(info['pume'],'close')
-                if info['pume'] is not None:
-                  wftool.doActionFor(info['pume'],'close')
+                #if info['pume'] is not None:
+                if student_pume is not None:
+                  #wftool.doActionFor(info['pume'],'close')
+                  wftool.doActionFor(student_pume,'close')
                 da = {}
                 pin = request.get('pin')
+                app_doc = student_app.getContent()
                 if not pin:
-                    jamb_reg_no = info['app_doc'].jamb_reg_no
+                    app_doc = student_app.getContent()
+                    jamb_reg_no = app_doc.jamb_reg_no
                     res = context.portal_pins(student=jamb_reg_no)
                     if len(res) == 1:
                         p = res[0].pin
-                        pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 
+                        if len(p) > 10:
+                            pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])
+                        else:
+                            pin = p
 ##                email = request.get('email')
-                app_doc = info['app_doc']
+                #app_doc = info['app_doc']
                 da['app_ac_pin'] = pin
 ##                da['app_email'] = email
@@ -98,11 +114,14 @@
 if to_waeup_student_home:
     #member.setProperties(last_login_time=current,login_time=current)
-    if info['review_state'] == "application_pin_entered":
+    #if info['review_state'] == "application_pin_entered":
+    if s_review_state == "application_pin_entered":
         return response.redirect("%s/application_edit" % student.absolute_url())
-    elif info['review_state'] == "admitted":
+    #elif info['review_state'] == "admitted":
+    elif s_review_state == "admitted":
         return response.redirect("%s/admission_form" % student.absolute_url())
-    elif info['review_state'] == "clearance_pin_entered":
+    #elif info['review_state'] == "clearance_pin_entered":
+    elif s_review_state == "clearance_pin_entered":
         return response.redirect("%s/clearance_edit" % student.absolute_url())
-    return response.redirect("%s/student_index" % info['url'])
+    return response.redirect("%s/student_index" % student.absolute_url())
 
 elif to_member_home:
