Ignore:
Timestamp:
30 Sep 2011, 08:24:05 (13 years ago)
Author:
Henrik Bettermann
Message:

Move removedStudentHandler to right place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r6830 r6836  
    2626    IStudent, IStudentNavigation, IStudentClearanceEdit,
    2727    IStudentPersonalEdit)
    28 from waeup.sirp.utils.helpers import attrs_to_fields
     28from waeup.sirp.utils.helpers import attrs_to_fields, get_current_principal
    2929from waeup.sirp.students.utils import generate_student_id
    3030
     
    9090    def getInterfaces(self):
    9191        return implementedBy(Student)
     92
     93@grok.subscribe(IStudent, grok.IObjectRemovedEvent)
     94def removedStudentHandler(student, event):
     95    """If a student is removed a message is logged.
     96    """
     97    comment = 'Student record removed'
     98    user = get_current_principal().id
     99    target = student.student_id
     100    grok.getSite()['students'].logger.info('%s - %s - %s' % (
     101        user, target, comment))
Note: See TracChangeset for help on using the changeset viewer.