Changeset 8332


Ignore:
Timestamp:
3 May 2012, 11:41:27 (13 years ago)
Author:
Henrik Bettermann
Message:

ObjectModifiedEvent? must be fired in updateEntry to ensure that catalogs involved are updated after setting attributes.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r8331 r8332  
    331331        self.assertEqual(container['2345'].reg_number, '6666')
    332332        shutil.rmtree(os.path.dirname(fin_file))
    333         # We have to inform the catalog that the reg_number has changed
    334         notify(grok.ObjectModifiedEvent(container['2345']))
     333
    335334        # Now we import another file which clears all middlename attributes
    336         # and uses the new reg_number as locator
     335        # and uses the new reg_number as locator. This test also checks
     336        # if the catalog has been informed about the reg_no change.
    337337        num, num_warns, fin_file, fail_file = self.processor.doImport(
    338338            self.csv_file_update2, APPLICANT_HEADER_FIELDS_UPDATE2, 'update')
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py

    r8330 r8332  
    3030from zope.interface import Interface
    3131from zope.schema import getFields
     32from zope.event import notify
    3233from waeup.kofa.interfaces import (
    3334    IBatchProcessor, FatalCSVError, IObjectConverter,
     
    216217            log_value = getattr(value, 'code', value)
    217218            changed.append('%s=%s' % (key, log_value))
     219
     220        # If any catalog is involved it must be updated
     221        notify(grok.ObjectModifiedEvent(obj))
     222
    218223        return ', '.join(changed)
    219224
Note: See TracChangeset for help on using the changeset viewer.