Fix a 500 error caused by retrieving peer workflow after an integrity error when using repeatable-read
Merge pull request #355 from edx/will/TIM-585

Bugfix: TIM-585