Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py	(revision 7521)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py	(revision 7522)
@@ -33,5 +33,6 @@
 from hurry.workflow.interfaces import IWorkflowState
 from waeup.sirp.interfaces import (
-    IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount)
+    IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount,
+    IObjectHistory)
 from waeup.sirp.students.interfaces import (
     IStudent, IStudentStudyCourseImport,
@@ -39,4 +40,5 @@
 from waeup.sirp.students.workflow import  IMPORTABLE_STATES
 from waeup.sirp.utils.batching import BatchProcessor
+from waeup.sirp.utils.helpers import get_current_principal
 
 class StudentProcessor(BatchProcessor):
@@ -131,4 +133,13 @@
         parent = self.getParent(row, site)
         parent.addStudent(obj)
+        # In some tests we don't have a students container or a user
+        try:
+            user = get_current_principal()
+            parent.logger.info('%s - %s - Student record imported' % (
+                user.id,obj.student_id))
+            history = IObjectHistory(obj)
+            history.addMessage('Student record imported')
+        except (TypeError, AttributeError):
+            pass
         return
 
@@ -145,8 +156,11 @@
         for key, value in row.items():
             # Set student password and all fields declared in interface.
-            if key == 'password':
+            if key == 'password' and value != '':
                 IUserAccount(obj).setPassword(value)
             elif key == 'reg_state':
                 IWorkflowState(obj).setState(value)
+                msg = "State '%s' set" % value
+                history = IObjectHistory(obj)
+                history.addMessage(msg)
             elif hasattr(obj, key):
                 setattr(obj, key, value)
@@ -183,7 +197,9 @@
             row, self.factory_name)
         if row.has_key('reg_state') and \
-            row['reg_state'] is not None and \
             not row['reg_state'] in IMPORTABLE_STATES:
-            errs.append(('reg_state','not allowed'))
+            if row['reg_state'] != '':
+                errs.append(('reg_state','not allowed'))
+            else:
+                errs.append(('reg_state','no value provided'))
         return errs, inv_errs, conv_dict
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data.csv
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data.csv	(revision 7521)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data.csv	(revision 7522)
@@ -1,5 +1,4 @@
-firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,reg_state
+firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
 Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
-Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,admitted
-Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,cleared
-John,Wolter,4,1990-01-04,100003,aa@aa.ng,1234,nonsense
+Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234
+Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv	(revision 7521)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv	(revision 7522)
@@ -3,3 +3,4 @@
 B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,cleared
 C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1,admitted
-D123456,John,Wolter,4,1990-01-04,100003,aa@aa.ng,1234,mypw1,nonsense
+D123456,John,Wolter,4,1990-01-05,100003,aa@aa.ng,1234,mypw1,nonsense
+E123456,John,Kennedy,5,1990-01-06,100004,aa@aa.ng,1234,
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py	(revision 7521)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py	(revision 7522)
@@ -163,5 +163,5 @@
         num, num_warns, fin_file, fail_file = self.importer.doImport(
             self.csv_file, STUDENT_HEADER_FIELDS)
-        self.assertEqual(num_warns,1)
+        self.assertEqual(num_warns,0)
         assert len(self.app['students'].keys()) == 4
         shutil.rmtree(os.path.dirname(fin_file))
@@ -197,5 +197,5 @@
         num, num_warns, fin_file, fail_file = self.importer.doImport(
             self.csv_file_migration, STUDENT_HEADER_FIELDS_MIGRATION)
-        self.assertEqual(num_warns,1)
+        self.assertEqual(num_warns,2)
         assert len(self.app['students'].keys()) == 4
         self.assertTrue('A123456' in self.app['students'].keys())
@@ -206,4 +206,7 @@
         self.assertEqual(self.app['students']['B123456'].date_of_birth,
             datetime.date(1990, 1, 3))
+        history = ' '.join(self.app['students']['A123456'].history.messages)
+        self.assertTrue(
+            "State 'school fee paid' set by system" in history)
         shutil.rmtree(os.path.dirname(fin_file))
 
