Changeset 6836 for main


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

Move removedStudentHandler to right place.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 edited

Legend:

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

    r6832 r6836  
    8383                user, ob_class, target, comment))
    8484        return
    85 
    86 @grok.subscribe(IStudent, grok.IObjectRemovedEvent)
    87 def removedStudentHandler(student, event):
    88     """If a student is removed a message is logged.
    89     """
    90     comment = 'Student record removed'
    91     user = get_current_principal().id
    92     target = student.student_id
    93     grok.getSite()['students'].logger.info('%s - %s - %s' % (
    94         user, target, comment))
  • 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.