Changeset 11028


Ignore:
Timestamp:
1 Feb 2014, 11:02:29 (11 years ago)
Author:
Henrik Bettermann
Message:

Catch error if current_level not set.

Location:
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students/browser.py

    r11025 r11028  
    25702570            emit_lock_message(self)
    25712571            return
     2572        code = self.context.current_level
     2573        if code is None:
     2574            self.flash(_('Your data are incomplete'), type="danger")
     2575            self.redirect(self.url(self.context))
     2576            return
    25722577        super(AddStudyLevelFormPage, self).update()
    25732578        return
     
    25842589            self.flash(_('This level exists.'), type="warning")
    25852590        except RequiredMissing:
    2586             self.flash(_('Your data are incomplete'), type="warning")
     2591            self.flash(_('Your data are incomplete'), type="danger")
    25872592        self.redirect(self.url(self.context))
    25882593        return
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students/tests/test_browser.py

    r11023 r11028  
    23612361        # Now students can add the current study level
    23622362        self.browser.getLink("Study Course").click()
     2363        self.student['studycourse'].current_level = None
     2364        self.browser.getLink("Add course list").click()
     2365        self.assertMatches('...Your data are incomplete...',
     2366                           self.browser.contents)
     2367        self.student['studycourse'].current_level = 100
    23632368        self.browser.getLink("Add course list").click()
    23642369        self.assertMatches('...Add current level 100 (Year 1)...',
Note: See TracChangeset for help on using the changeset viewer.