mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
The behaviour of stacking the version decorators does not work as expected. What you would expect to happen is that each decorator causes a history row to be written for its respective model object. What actually happens is that the first decorator adds history records to the database session, but then causes the database session to commit. This means that subsequent uses of this decorator find a clean session, and therefore no changes to copy to their respective history tables. This commit changes the intended use of the decorator so that it is only used once per function, and accepts multiple definitions of what to record history for. This way it can record everything that needs to go into the history before doing anything that would risk flushing the session.
2.3 KiB
2.3 KiB