rearrange an if to be less nested
Merge pull request #1862 from dimagi/rearrange-if

rearrange an if to be less nested