Make sure all contact info is "touched" when touching person record

This commit is contained in:
Lance Edgar 2020-03-11 13:30:04 -05:00
parent 12b0ac1037
commit d72f61a98d
2 changed files with 31 additions and 9 deletions

View file

@ -1154,27 +1154,20 @@ class MasterView(View):
alternative.
"""
obj = self.get_instance()
change = self.touch_instance(obj)
self.touch_instance(obj)
self.request.session.flash("{} has been touched: {}".format(
self.get_model_title(), self.get_instance_title(obj)))
return self.redirect(self.get_action_url('view', obj))
def touch_instance(self, obj):
"""
Perform actual "touch" logic for the given object. Must return the
:class:`rattail:~rattail.db.model.Change` record involved.
.. todo::
Why should this return the change object? We're not using it for
anything (yet?) but some views may generate multiple changes when
touching the primary object, i.e. touch related objects also.
Perform actual "touch" logic for the given object.
"""
change = model.Change()
change.class_name = obj.__class__.__name__
change.instance_uuid = obj.uuid
change = self.Session.merge(change)
change.deleted = False
return change
def versions(self):
"""