Index: WAeUP_SRP/trunk/skins/waeup_directory/search_members.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_directory/search_members.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_directory/search_members.py	(revision 1845)
@@ -11,9 +11,10 @@
 
 from Products.CPSDirectory.BaseDirectory import SearchSizeLimitExceeded
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_portal = context.portal_catalog.evalAdvancedQuery
 try:
-    from Products.AdvancedQuery import Eq, Between, Le,In
-    evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
+    aq_portal = context.portal_catalog.evalAdvancedQuery
 except:
-    evalAdvancedQuery = None
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 
 datamodel = datastructure.getDataModel()
@@ -80,5 +81,5 @@
     query = In('portal_type',('Faculty','Department')) &\
             In('localUsersWithRoles',('user:%s' % user_id,))
-    res = evalAdvancedQuery(query)
+    res = aq_portal(query)
     facs = []
     roles = []
Index: WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py	(revision 1845)
@@ -36,13 +36,13 @@
     response.setHeader('Content-type','text/html; charset=ISO-8859-15')
     response.write("%s<br>\n" % s)
+from Products.AdvancedQuery import Eq, Between, Le,In
 try:
-    from Products.AdvancedQuery import Eq, Between, Le,In
     aq_portal = context.portal_catalog.evalAdvancedQuery
-    aq_students = context.students_catalog.evalAdvancedQuery
 except:
-    aq_portal = None
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
+aq_students = context.students_catalog.evalAdvancedQuery
 
 query1 = Eq('portal_type','Payment')
-query2 = Eq('SearchableText',"Approved Successful")	 	
+query2 = Eq('SearchableText',"Approved Successful")             
 online_payments = aq_portal(query1 & query2)
 set_trace()
Index: WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1845)
@@ -16,4 +16,9 @@
 if mtool.isAnonymousUser():
     return None
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
 
 
@@ -32,5 +37,5 @@
 request = context.REQUEST
 students = context.portal_url.getPortalObject().campus.students
-
+#set_trace()
 student_id = context.getStudentId()
 if student_id is None:
Index: WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py	(revision 1845)
@@ -25,5 +25,8 @@
 course_cat = context.courses_catalog
 from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog.evalAdvancedQuery
+try:
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+except:
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 course_id = request.get('course_id')
 
Index: WAeUP_SRP/trunk/skins/waeup_student/create_level.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/create_level.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/create_level.py	(revision 1845)
@@ -13,5 +13,8 @@
         pass
 from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog.evalAdvancedQuery
+try:
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+except:
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 aq_courses = context.courses_catalog.evalAdvancedQuery
 
@@ -37,4 +40,5 @@
     logger.info('%s tried to add already existing level %s' % (student.id,current_level))
     return
+logger.info('%s started to create level %s' % (student.id,current_level))
 
 ##if in_progress in ('not started','started'):
@@ -53,5 +57,4 @@
 else:
     context.invokeFactory('StudentStudyLevel',"%s" % current_level)
-    logger.info('%s started to create level %s' % (student.id,current_level))
     level = getattr(context,"%s" % current_level)
     context.portal_workflow.doActionFor(level,'open')
@@ -76,5 +79,5 @@
         c_res = aq_courses(query)
         if not c_res:
-            logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
+            #logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
             continue
         course_cat_entry = c_res[0]
@@ -86,7 +89,7 @@
                 score = int(co.Score)
             except:
-                logger.info('%s, course %s has invalid score %s"' % (student.id,
-                                                                    co.CosCode,
-                                                                    co.Score))
+                # logger.info('%s, course %s has invalid score %s"' % (student.id,
+                #                                                     co.CosCode,
+                #                                                     co.Score))
                 continue
             if int(c_res[0].passmark) <= score:
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1845)
@@ -12,9 +12,9 @@
 return the review_state of the Student
 """
+from Products.AdvancedQuery import Eq, Between, Le,In
 try:
-    from Products.AdvancedQuery import Eq, Between, Le,In
     aq_portal = context.portal_catalog.evalAdvancedQuery
 except:
-    aq_portal = None
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 if student_id is None:
     student_id = context.getStudentId()
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py	(revision 1845)
@@ -26,5 +26,8 @@
         
 from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog.evalAdvancedQuery
+try:
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+except:
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 request = context.REQUEST
 #session = request.SESSION
Index: WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 1845)
@@ -19,5 +19,8 @@
         pass
 from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog.evalAdvancedQuery
+try:
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+except:
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
 aq_courses = context.courses_catalog.evalAdvancedQuery
 
Index: WAeUP_SRP/trunk/skins/waeup_student/search_students.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1845)
@@ -31,10 +31,10 @@
 if is_anon:
     allowed = False
+from Products.AdvancedQuery import Eq, Between, Le,In
 try:
-    from Products.AdvancedQuery import Eq, Between, Le,In
-    evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
-    aq_students = context.students_catalog.evalAdvancedQuery
+    aq_portal = context.portal_catalog.evalAdvancedQuery
 except:
-    evalAdvancedQuery = None
+    aq_portal = context.portal_catalog_real.evalAdvancedQuery
+aq_students = context.students_catalog.evalAdvancedQuery
 
 def cmp_id(a,b):
@@ -81,5 +81,5 @@
         query = In('portal_type',('Faculty',)) &\
                  In('localUsersWithRoles', ("user:%s" % member,))
-        res = evalAdvancedQuery(query)
+        res = aq_portal(query)
         logger.info('ClearanceOfficer %s initiated student_search' % member)
         faculties = []
@@ -90,5 +90,5 @@
         query = In('portal_type',('Department',)) &\
                  In('localUsersWithRoles', ("user:%s" % member,))
-        res = evalAdvancedQuery(query)
+        res = aq_portal(query)
         departments = []
         if res:
@@ -107,5 +107,5 @@
         query = In('portal_type',('StudyLevel',)) &\
                  In('localUsersWithRoles', ("user:%s" % member,))
-        res = evalAdvancedQuery(query)
+        res = aq_portal(query)
         logger.info('CourseAdviser %s initiated student_search' % member)
         certificate_level = []
@@ -195,5 +195,5 @@
         query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
         logger.info('%s searches for student with name %s' % (member,term))
-        res = evalAdvancedQuery(query)
+        res = aq_portal(query)
         if res:
             for r in res:
@@ -207,5 +207,5 @@
         logger.info('"%s","start 100"' % member)
     query = Eq('review_state',state)
-    review_res = evalAdvancedQuery(query)
+    review_res = aq_portal(query)
 
     logger.info('%s searches for students in review_state %s' % (member,state))
Index: WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 1843)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 1845)
@@ -12,6 +12,9 @@
 return the current student_index
 """
-from Products.AdvancedQuery import Eq, Between, Le,In
-evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
+# from Products.AdvancedQuery import Eq, Between, Le,In
+# try:
+#     aq_portal = context.portal_catalog.evalAdvancedQuery
+# except:
+#     aq_portal = context.portal_catalog_real.evalAdvancedQuery
 
 request = context.REQUEST
