Changeset 16074 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 26 Apr 2020, 09:21:39 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r16073 r16074 1099 1099 dict(name=x, title=y) for x, y in allowed_transitions] 1100 1100 1101 def saveCourses(self, changed_fields): 1102 """In custom packages we needed to customize the certificate 1103 select widget. We just save course1 and course2 if these customized 1104 fields appear in the form. 1105 """ 1106 return changed_fields 1107 1101 1108 @action(_('Save'), style='primary') 1102 1109 def save(self, **data): … … 1119 1126 else: 1120 1127 changed_fields = [] 1121 # In custom packages we needed to customize the certificate 1122 # select widget. We just save course1 and course2 if these customized 1123 # fields appear in the form. 1124 course1 = form.get('custom.course1', None) 1125 course2 = form.get('custom.course2', None) 1126 cat = queryUtility(ICatalog, name='certificates_catalog') 1127 if course1: 1128 results = list( 1129 cat.searchResults(code=(course1, course1))) 1130 self.context.course1 = results[0] 1131 changed_fields.append('course1') 1132 if course2: 1133 results = list( 1134 cat.searchResults(code=(course2, course2))) 1135 self.context.course2 = results[0] 1136 changed_fields.append('course2') 1128 changed_fields = self.saveCourses(changed_fields) 1137 1129 if password: 1138 1130 # Now we know that the form has no errors and can set password ... … … 1293 1285 return 1294 1286 1287 def saveCourses(self): 1288 """In custom packages we needed to customize the certificate 1289 select widget. We just save course1 and course2 if these customized 1290 fields appear in the form. 1291 """ 1292 return 1293 1295 1294 @action(_('Save'), style='primary') 1296 1295 def save(self, **data): … … 1299 1298 return 1300 1299 self.applyData(self.context, **data) 1300 self.saveCourses() 1301 1301 self.flash(_('Form has been saved.')) 1302 1302 return
Note: See TracChangeset for help on using the changeset viewer.