add get_document_or_404 and have _get_case_or_404 call it
Merge pull request #4334 from dimagi/get-doc-or-404

add get_document_or_404 and have _get_case_or_404 call it