Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 12190)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 12191)
@@ -4,4 +4,6 @@
 1.3dev (unreleased)
 ===================
+
+* Do not import codes with spaces.
 
 * UserProcessor: Check if imported roles do exist in the portal.
Index: /main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt	(revision 12190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt	(revision 12191)
@@ -509,4 +509,5 @@
     ... FAC1,Faculty 1,faculty
     ... FAC4,Faculty 4,school
+    ... FAC 5,Faculty 5,faculty
     ... """)
 
@@ -550,10 +551,10 @@
     >>> browser.getControl('Perform import').click()
 
-One line could not be imported:
+Two lines could not be imported:
 
     >>> print browser.contents
     <!DOCTYPE html PUBLIC...
     ...
-    ...Processing of 1 rows failed...
+    ...Processing of 2 rows failed...
     ...Successfully processed 1 rows...
     ...
@@ -566,4 +567,5 @@
     title_prefix,code,title,--ERRORS--
     faculty,FAC1,Faculty 1,This object already exists. Skipping.
+    faculty,FAC 5,Faculty 5,code: must not contain spaces
 
     >>> finished_file = dc_path + '/finished/newfaculties_zope.mgr.create.finished.csv'
@@ -586,5 +588,5 @@
     >>> open(dc_path + '/newfaculties_zope.mgr.create.pending.csv', 'wb').write(
     ... """title_prefix,--IGNORE--,code,title
-    ... faculty,FAC5,Faculty 5
+    ... faculty,,FAC5,Faculty 5
     ... """)
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 12190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 12191)
@@ -271,4 +271,6 @@
         errs, inv_errs, conv_dict =  converter.fromStringDict(
             row, self.factory_name, mode=mode)
+        if 'code' in row and ' ' in row['code']:
+            errs.append(('code','must not contain spaces'))
         return errs, inv_errs, conv_dict
 
