fix cloudcare 500 resulting from mistakenly looking up referral details
Merge pull request #3726 from dimagi/cloudcare-hotfix

fix cloudcare 500 resulting from mistakenly looking up referral details