Bugfix: TIM-585

[TIM-585](https://edx-wiki.atlassian.net/browse/TIM-585)

Fix a 500 error caused by retrieving peer workflow after an integrity error when using repeatable-read