Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 9028)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 9029)
@@ -452,5 +452,6 @@
         """
         current_level = row.get('current_level', None)
-        if current_level == '999' and obj.state in FORBIDDEN_POSTGRAD_STATES:
+        if current_level == '999' and \
+            obj.__parent__.state in FORBIDDEN_POSTGRAD_STATES:
             return 'Not a pg student.'
         return None
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9028)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9029)
@@ -241,5 +241,4 @@
 
 
-
 class StudentProcessorTest(StudentImportExportSetup):
 
@@ -491,4 +490,11 @@
         super(StudentStudyCourseProcessorTest, self).setUp()
 
+        # Add student with subobjects
+        student = Student()
+        self.app['students'].addStudent(student)
+        student = self.setup_student(student)
+        notify(grok.ObjectModifiedEvent(student))
+        self.student = self.app['students'][student.student_id]
+
         # Import students with subobjects
         student_file = os.path.join(self.workdir, 'sample_student_data.csv')
@@ -537,4 +543,17 @@
             dict(reg_number='1', current_level='100'))
         self.assertEqual(len(errs),0)
+
+    def test_checkUpdateRequirements(self):
+        # Make sure that pg students can't be updated with wrong transition.
+        err = self.processor.checkUpdateRequirements(self.student['studycourse'],
+            dict(reg_number='1', current_level='100'), self.app)
+        self.assertTrue(err is None)
+        err = self.processor.checkUpdateRequirements(self.student['studycourse'],
+            dict(reg_number='1', current_level='999'), self.app)
+        self.assertTrue(err is None)
+        IWorkflowState(self.student).setState('returning')
+        err = self.processor.checkUpdateRequirements(self.student['studycourse'],
+            dict(reg_number='1', current_level='999'), self.app)
+        self.assertEqual(err, 'Not a pg student.')
 
     def test_import(self):
@@ -672,5 +691,4 @@
         self.assertEqual(num_warns,2)
         shutil.rmtree(os.path.dirname(fin_file))
-        
 
 class CourseTicketProcessorTest(StudentImportExportSetup):
