Ignore:
Timestamp:
28 Aug 2020, 08:04:20 (4 years ago)
Author:
Henrik Bettermann
Message:

Simplify course change.

File:
1 edited

Legend:

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

    r16217 r16218  
    11071107            dict(name=x, title=y) for x, y in allowed_transitions]
    11081108
    1109     def saveCourses(self, changed_fields):
     1109    def saveCourses(self):
    11101110        """In custom packages we needed to customize the certificate
    11111111        select widget. We just save course1 and course2 if these customized
    11121112        fields appear in the form.
    11131113        """
    1114         error = None
    1115         return error, changed_fields
     1114        return None, []
    11161115
    11171116    @action(_('Save'), style='primary')
     
    11351134        else:
    11361135            changed_fields = []
    1137         error, changed_fields = self.saveCourses(changed_fields)
     1136        error, changed_courses = self.saveCourses()
    11381137        if error:
    1139             self.flash(error)
    1140             return
     1138            self.flash(error, type='danger')
     1139            return
     1140        changed_fields += changed_courses
    11411141        if password:
    11421142            # Now we know that the form has no errors and can set password ...
     
    12971297        return
    12981298
    1299     def saveCourses(self):
    1300         """In custom packages we needed to customize the certificate
    1301         select widget. We just save course1 and course2 if these customized
    1302         fields appear in the form.
    1303         """
    1304         return
    1305 
    13061299    @action(_('Save'), style='primary')
    13071300    def save(self, **data):
     
    13101303            return
    13111304        self.applyData(self.context, **data)
    1312         error = self.saveCourses()
     1305        error, dummy = self.saveCourses()
    13131306        if error:
    1314             self.flash(error)
     1307            self.flash(error, type='danger')
    13151308            return
    13161309        self.flash(_('Form has been saved.'))
     
    13591352            return
    13601353        self.applyData(self.context, **data)
     1354        error, dummy = self.saveCourses()
     1355        if error:
     1356            self.flash(error, type='danger')
     1357            return
    13611358        state = IWorkflowState(self.context).getState()
    13621359        # This shouldn't happen, but the application officer
Note: See TracChangeset for help on using the changeset viewer.