Ignore:
Timestamp:
28 Aug 2020, 06:48:35 (4 years ago)
Author:
Henrik Bettermann
Message:

Catch error if courses can't be saved (e.g. if not selected).

File:
1 edited

Legend:

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

    r16215 r16217  
    11121112        fields appear in the form.
    11131113        """
    1114         return changed_fields
     1114        error = None
     1115        return error, changed_fields
    11151116
    11161117    @action(_('Save'), style='primary')
     
    11341135        else:
    11351136            changed_fields = []
    1136         changed_fields = self.saveCourses(changed_fields)
     1137        error, changed_fields = self.saveCourses(changed_fields)
     1138        if error:
     1139            self.flash(error)
     1140            return
    11371141        if password:
    11381142            # Now we know that the form has no errors and can set password ...
     
    13061310            return
    13071311        self.applyData(self.context, **data)
    1308         self.saveCourses()
     1312        error = self.saveCourses()
     1313        if error:
     1314            self.flash(error)
     1315            return
    13091316        self.flash(_('Form has been saved.'))
    13101317        return
Note: See TracChangeset for help on using the changeset viewer.