Ignore:
Timestamp:
26 Apr 2020, 09:21:39 (5 years ago)
Author:
Henrik Bettermann
Message:

Only enable customization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r16073 r16074  
    10991099            dict(name=x, title=y) for x, y in allowed_transitions]
    11001100
     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
    11011108    @action(_('Save'), style='primary')
    11021109    def save(self, **data):
     
    11191126        else:
    11201127            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)
    11371129        if password:
    11381130            # Now we know that the form has no errors and can set password ...
     
    12931285        return
    12941286
     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
    12951294    @action(_('Save'), style='primary')
    12961295    def save(self, **data):
     
    12991298            return
    13001299        self.applyData(self.context, **data)
     1300        self.saveCourses()
    13011301        self.flash(_('Form has been saved.'))
    13021302        return
Note: See TracChangeset for help on using the changeset viewer.