Prevent infinite recursion
Merge pull request #4778 from dimagi/fix-infinite-recursion

Prevent infinite recursion