Skip to content

Commit

Permalink
datastore: override put method to add changes to db history
Browse files Browse the repository at this point in the history
  • Loading branch information
yashlamba committed Nov 8, 2023
1 parent 05657e0 commit 6595d6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions invenio_accounts/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def commit(self):
datastore_post_commit.send(session=self.db.session)
current_db_change_history.clear_dirty_sets(self.db.session)

def put(self, model):
"""Put a user to its session."""
res = super().put(model)
self.mark_changed(id(self.db.session), uid=model.id)
return res

def mark_changed(self, sid, uid=None, rid=None):
"""Save a user to the changed history."""
if uid:
Expand Down

0 comments on commit 6595d6b

Please sign in to comment.