Allow for empty prof['degrees'] in export_mysql
authorW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 01:07:27 +0000 (21:07 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 27 Jun 2010 01:07:27 +0000 (21:07 -0400)
sitecore/prof/export_mysql.py

index ba6bece5d16e0a48833c897884a1e8f5fe7e0a9e..a7701c5112af0266d16d2567566be465758728dd 100644 (file)
@@ -174,7 +174,10 @@ Where the relevant categories are
             if prof['position1'] != None:
                 p.title += ', %s' % prof['position1']
             p.graduations = []
-            for degree in prof['degrees'].splitlines():
+            degrees = []
+            if prof['degrees'] != None:
+                degrees = prof['degrees'].splitlines()
+            for degree in degrees:
                 m = GRADUATION_REGEXP.match(degree.strip())
                 assert m != None, 'Misformed graduation: %s' % degree
                 title,field,college,comma_year,year = m.groups()