Ignore:
Timestamp:
26 Nov 2011, 16:01:30 (13 years ago)
Author:
uli
Message:

Try to fix #65. Manually remove each course/certificate from a
container instead of using the (very fast) clear method. The latter
does not trigger IObjectRemoved events for courses and certificates.
Henrik, does it work better in UI now?
See https://trac.waeup.org/ticket/65

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/university/catalog.py

    r7195 r7211  
    122122    """Clear courses and certificates when a department is killed.
    123123    """
    124     obj.courses.clear()
    125     obj.certificates.clear()
     124    # We cannot use the 'clear()' method of respective subcontainers
     125    # (courses, certificates), because that would not trigger
     126    # IObjectRemoved events.
     127    for subobj_name in ['courses', 'certificates']:
     128        key_list = list(getattr(obj, subobj_name, []).keys())
     129        for key in key_list:
     130            del getattr(obj, subobj_name)[key]
    126131    return
    127132
Note: See TracChangeset for help on using the changeset viewer.