equal
deleted
inserted
replaced
53 """update an entity -> set modification date""" |
53 """update an entity -> set modification date""" |
54 __regid__ = 'metaattrsupdate' |
54 __regid__ = 'metaattrsupdate' |
55 events = ('before_update_entity',) |
55 events = ('before_update_entity',) |
56 |
56 |
57 def __call__(self): |
57 def __call__(self): |
58 self.entity.setdefault('modification_date', datetime.now()) |
58 # repairing is true during c-c upgrade/shell and similar commands. We |
|
59 # usually don't want to update modification date in such cases. |
|
60 # |
|
61 # XXX to be really clean, we should turn off modification_date update |
|
62 # explicitly on each command where we do not want that behaviour. |
|
63 if not self._cw.vreg.config.repairing: |
|
64 self.entity.setdefault('modification_date', datetime.now()) |
59 |
65 |
60 |
66 |
61 class _SetCreatorOp(hook.Operation): |
67 class _SetCreatorOp(hook.Operation): |
62 |
68 |
63 def precommit_event(self): |
69 def precommit_event(self): |