Index: /waeup/branches/ulif-rewrite/src/waeup/utils/csvimport.py
===================================================================
--- /waeup/branches/ulif-rewrite/src/waeup/utils/csvimport.py	(revision 4480)
+++ /waeup/branches/ulif-rewrite/src/waeup/utils/csvimport.py	(revision 4481)
@@ -6,5 +6,6 @@
 from waeup.interfaces import IFacultyContainer, IWAeUPCSVImporter
 from waeup.utils.importexport import CSVImporter
-from zope.component import createObject
+from zope.app.catalog.interfaces import ICatalog
+from zope.component import createObject, getUtility
 
 #
@@ -204,10 +205,10 @@
             del row['department_code']
 
-            course = dept.courses[code]
-
             cert_code = row['certificate_code']
             cert = dept.certificates[cert_code]
             del row['certificate_code']
 
+            course = self.getCourse(code)
+            
             # Type casts...
             row['core_or_elective'] = toBool(row['core_or_elective'])
@@ -217,2 +218,18 @@
         return
 
+    def getCourse(self, code):
+        """Get the course with code `code`.
+
+        Courses can be anywhere in the site. Therefore we ask the
+        catalog.
+        """
+        cat = getUtility(ICatalog, name='courses_catalog')
+        result = cat.searchResults(code=(code, code))
+        if len(result) < 1:
+            raise KeyError('No such course found: %s' % code)
+
+        # We might get more than one result, but this should not
+        # happen, as course codes are supposed to be unique.
+        return list(result)[0]
+
+        
