Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1254)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1255)
@@ -168,5 +168,6 @@
         validlevel = False
         try:
-            int(level)
+            il = int(level) + 100
+            level = "%s" % il
             validlevel = True
         except:
@@ -179,5 +180,6 @@
                 level = erg[0].Level
             try:
-                int(level)
+                il = int(level) + 100
+                level = "%s" % il
                 em = '"%s","fixed Level from results_import","%s"' % (student.matric_no,erg[0].Level)
                 logger.info(em)
Index: /WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py	(revision 1254)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py	(revision 1255)
@@ -58,4 +58,5 @@
                     )
 s_brain = res[0]
+info['error'] = None
 info['matric_no']=s_brain.matric_no
 info['jamb_reg_no']=s_brain.jamb_reg_no
@@ -100,5 +101,15 @@
         #from Products.zdb import set_trace; set_trace()
         certificate = c_brain.getObject().getContent()
-        if int(s_brain.level) +100 == int(certificate.end_level):
+        try:
+            certlevel = int(certificate.end_level)
+        except:
+            info["error"] = '"no end_level for","%s"' % c_brain.getId
+            return info
+        try:
+            studentlevel = int(s_brain.level) + 100
+        except:
+            info["error"] = '"no level for","%s"' % s_brain.getId
+            return info
+        if studentlevel >= certlevel:
             bt = "fi"
 d['sex'] = 'male'
Index: /WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py	(revision 1254)
+++ /WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py	(revision 1255)
@@ -53,7 +53,12 @@
                       button = button
                       )
-if psm == 'invalid':
+if psm == 'invalid' or info['error'] is not None:
+    member_id = str(context.portal_membership.getAuthenticatedMember())
+    logger.info('"%s", %s' % (member_id,info['error'] ))
+    if psm == 'invalid':
+        psm = "please correct your input"
+    else:
+        psm = "Error in Data, unable to reserve bed."
     return context.accommodation_pin_edit_form(rendered = res,
-                                 psm = "Please correct your input!",
                                  #psm = "%s, %s" % (psm,ds),
                                  mode = mode,
Index: /WAeUP_SRP/trunk/skins/waeup_utilities/createReturningStudent.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_utilities/createReturningStudent.py	(revision 1254)
+++ /WAeUP_SRP/trunk/skins/waeup_utilities/createReturningStudent.py	(revision 1255)
@@ -19,27 +19,4 @@
 logger = logging.getLogger('createReturningStudent')
 
-#if str(member) not in ("admin","joachim"):
-#    return "not possible"
-
-
-#defined in WAeUPTool.py
-
-# def createOne(student_brain):
-#     sid = context.waeup_tool.generateStudentId('?')
-#     students_folder.invokeFactory('Student', sid)
-#     student = getattr(students_folder,sid)
-#     wftool.doActionFor(student,'return')
-#     student.manage_setLocalRoles(sid, ['Owner',])
-#     jamb_reg_no = student_brain.Entryregno,
-#     context.students_catalog.addRecord(id = sid,
-#                                        matric_no = matric_no,
-#                                        jamb_reg_no = jamb_reg_no,
-#                                        sex = student_brain.Sex == "F",
-#                                        name = "%s %s %s" % (student_brain.Firstname,
-#                                                             student_brain.Middlename,
-#                                                             student_brain.Lastname)
-#                                     )
-#     return sid,jamb_reg_no
-
 if not matric_no:
     return "No MatricNo"
@@ -52,5 +29,5 @@
         return "MatricNo %s not found in Returning Table" % matric_no
     student_brain = res[0]
-    sid,jamb_reg_no = context.waeup_tool.createOne(student_brain)
+    sid,jamb_reg_no = context.waeup_tool.createOne(students_folder,student_brain,'?')
     logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
     return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no)
@@ -66,10 +43,13 @@
         continue
     if count > 100:
-        context.waeup_tool.createOne(student,commit=True)
+        context.waeup_tool.createOne(students_folder,student,'Z',commit=True)
         logger.info('"%s","Commited Students","%s", "%s" ' % (member,count,total))
         total += count
         count = 1
+        if total > 500:
+            break
     else:
-        context.waeup_tool.createOne(student)
-        count += 1
+        for letter in ('ABCDEFGHKLMNPQRSTUVWXY'):
+            context.waeup_tool.createOne(students_folder,student,letter)
+            count += 1
 logger.info('"%s","Create Students finish","%s"' % (member,total))
Index: /WAeUP_SRP/trunk/skins/waeup_utilities/increaseReturningLevels.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_utilities/increaseReturningLevels.py	(revision 1255)
+++ /WAeUP_SRP/trunk/skins/waeup_utilities/increaseReturningLevels.py	(revision 1255)
@@ -0,0 +1,40 @@
+## Script (Python) "search_pins"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST
+##title=
+##
+# $Id$
+"""
+list Students for ClearanceOfficers
+"""
+
+request = REQUEST
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+retcat = context.returning_import
+rcat = context.results_import
+scat = context.students_catalog
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_students = context.students_catalog.evalAdvancedQuery
+
+if str(member) not in ('admin','joachim'):
+    return 
+count = 0
+from Products.zdb import set_trace;set_trace()
+returning = retcat(email='')
+l = []
+for sb in returning[:100]:
+    s = context.students_catalog(matric_no=sb.matric_no)
+    if s and s[0].level:
+        level = "%s" % (int(s[0].level) + 100)
+        context.students_catalog.modifyRecord(id = s[0].id,
+                                              level=level)
+        l.append("%s old/new %s/%s" % (s[0].id,s[0].level,level))
+return "\n".join(l)
+
+        
