fix 500 on deploying remote apps
Merge pull request #3572 from dimagi/cz

fix 500 on deploying remote apps