Index: /WAeUP_SRP/trunk/skins/waeup_utilities/fixEntryModeFromRegno.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_utilities/fixEntryModeFromRegno.py	(revision 1474)
+++ /WAeUP_SRP/trunk/skins/waeup_utilities/fixEntryModeFromRegno.py	(revision 1475)
@@ -44,11 +44,15 @@
     level_cat = sb.level
     new_em = context.getEntryMode(sb.jamb_reg_no)
-    if students.hasObject('application'):
-        app = getattr(getattr(students,sb.id),'application')
-        app.getContent().edit(mapping={'entry_mode': new_em})
-        cat.modifyRecord(id = sb.id,entry_mode = new_em)
-    else:
+    app_found = False
+    if students.hasObject(sb.id):
+        student_obj = getattr(students,sb.id)
+        if student_obj.hasObject('application'):
+            app = getattr(student_obj,'application')
+            app.getContent().edit(mapping={'entry_mode': new_em})
+            cat.modifyRecord(id = sb.id,entry_mode = new_em)
+            app_found = True
+    if not app_found:
         cat.modifyRecord(id = sb.id,entry_mode = "")
-    s = '"%s","%s","%s","%s","%s","%s"' % (sb.id,sb.matric_no,em,
+    s = '"%s","%s","%s","%s","%s","%s","%s"' % (app_found,sb.id,sb.matric_no,em,
                                                 sb.jamb_reg_no,new_em,level_cat)
     #lines.append('"%s","%s","%s","%s"' % (sb.id,sb.matric_no,moe,new_em))
