Changeset 2283 for WAeUP_SRP/base
- Timestamp:
- 27 Sep 2007, 17:08:18 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r2282 r2283 27 27 from Globals import InitializeClass 28 28 from OFS.SimpleItem import SimpleItem 29 from zExceptions import BadRequest 29 30 30 31 from Products.CMFCore.utils import getToolByName … … 920 921 return '', "Faculty with ID: %s exists" % fid 921 922 logger.info('Creating Faculty %(code)s, %(title)s' % mapping) 922 academics_folder.invokeFactory('Faculty', fid) 923 try: 924 academics_folder.invokeFactory('Faculty', fid) 925 except BadRequest,E: 926 return '', "%s" % E 923 927 f = getattr(academics_folder,fid,None) 924 928 f.getContent().edit(mapping=mapping) … … 958 962 if d is None or d.portal_type == "Faculty": 959 963 logger.info('Creating Department %(code)s, %(title)s' % mapping) 960 f.invokeFactory('Department', did) 964 try: 965 f.invokeFactory('Department', did) 966 except BadRequest,E: 967 return '', "%s" % E 961 968 d = getattr(f,did) 962 969 d.invokeFactory('CoursesFolder','courses') … … 1009 1016 if c is not None: 1010 1017 return '', "Duplicate Department ID: %s" % did 1011 d.invokeFactory('Course', course_id) 1018 try: 1019 d.invokeFactory('Course', course_id) 1020 except BadRequest,E: 1021 return '', "%s" % E 1012 1022 self._v_course_list.append(course_id) 1013 1023 c = getattr(d,course_id) … … 1047 1057 if c is not None: 1048 1058 return '', "Duplicate Department ID: %s" % did 1049 d.invokeFactory('Certificate', certificate_id) 1059 try: 1060 d.invokeFactory('Certificate', certificate_id) 1061 except BadRequest,E: 1062 return '', "%s" % E 1050 1063 self._v_certificate_list.append(certificate_id) 1051 1064 c = getattr(d,certificate_id) … … 1375 1388 adapters = [MappingStorageAdapter(schema, item)] 1376 1389 logger.info('%s starts import from %s.csv' % (member,filename)) 1377 #import_keys = [k for k in item.keys() if not k.startswith('ignore')]1378 1390 attrs = csv.reader(open("%s/import/%s.csv" % (i_home,filename),"rb")).next() 1379 1391 import_keys = [k for k in attrs if not k.startswith('ignore')]
Note: See TracChangeset for help on using the changeset viewer.