From: W. Trevor King Date: Sun, 27 Jun 2010 01:07:27 +0000 (-0400) Subject: Allow for empty prof['degrees'] in export_mysql X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=045bb91fb09fedb6baea5ea7ab9b926ad8943ecf;p=sitecorepy.git Allow for empty prof['degrees'] in export_mysql --- diff --git a/sitecore/prof/export_mysql.py b/sitecore/prof/export_mysql.py index ba6bece..a7701c5 100644 --- a/sitecore/prof/export_mysql.py +++ b/sitecore/prof/export_mysql.py @@ -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()