Ignore:
Timestamp:
21 May 2019, 10:08:08 (5 years ago)
Author:
Henrik Bettermann
Message:

Add student history message if a graduated student was created.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r15417 r15418  
    234234                value = row['state']
    235235                IWorkflowState(obj).setState(value)
    236                 notify(grok.ObjectModifiedEvent(obj))
    237236                msg = _("State '${a}' set", mapping = {'a':value})
    238237                history = IObjectHistory(obj)
     
    268267                '%s - %s - %s - imported: %s'
    269268                % (self.name, filename, obj.student_id, items_changed))
     269        notify(grok.ObjectModifiedEvent(obj))
    270270        return items_changed
    271271
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r15417 r15418  
    377377        IWorkflowState(student).setState(GRADUATED)
    378378        notify(grok.ObjectModifiedEvent(student))
    379         self.flash(_('Student record created.'))
     379        history = IObjectHistory(student)
     380        history.addMessage("Set to 'graduated'")
     381        self.flash(_('Graduated student record created.'))
    380382        self.redirect(self.url(self.context[student.student_id], 'index'))
    381383        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r15334 r15418  
    442442        self.browser.getControl(name="form.reg_number").value = '1234'
    443443        self.browser.getControl("Create graduated student").click()
    444         self.assertTrue('Student record created' in self.browser.contents)
     444        self.assertTrue('Graduated student record created' in self.browser.contents)
    445445        self.assertEqual(self.app['students']['K1000001'].state, 'graduated')
     446        self.browser.open("http://localhost/app/students/K1000001/history")
     447        self.assertTrue("Set to 'graduated' by Manager" in self.browser.contents)
    446448        return
    447449
Note: See TracChangeset for help on using the changeset viewer.