Ignore:
Timestamp:
25 Apr 2020, 06:10:17 (5 years ago)
Author:
Henrik Bettermann
Message:

In custom packages we needed to customize the certificate
select widget. We just save course1 and course2 if these customized fields appear in the form.

File:
1 edited

Legend:

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

    r16064 r16072  
    787787            return
    788788        if not self.context.special:
    789             for key in self.context.keys():
    790                 ticket = self.context[key]
     789            for ticket in self.context.payments:
    791790                if ticket.p_state == 'paid':
    792791                      self.flash(
     
    11201119        else:
    11211120            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        if course1:
     1127            cat = queryUtility(ICatalog, name='certificates_catalog')
     1128            results = list(
     1129                cat.searchResults(code=(course1, course1)))
     1130            self.context.course1 = results[0]
     1131            changed_fields.append('course1')
     1132        if course2:
     1133            cat = queryUtility(ICatalog, name='certificates_catalog')
     1134            results = list(
     1135                cat.searchResults(code=(course2, course2)))
     1136            self.context.course2 = results[0]
     1137            changed_fields.append('course1')
    11221138        if password:
    11231139            # Now we know that the form has no errors and can set password ...
Note: See TracChangeset for help on using the changeset viewer.