def _get_doc_and_fallback_reason(document_locale, document_slug):
 doc = None
 fallback_reason = None
 try:
  doc = Document.objects.get(locale=document_locale, slug=document_slug)
  if ((not doc.current_revision) and doc.parent and doc.parent.current_revision):
   fallback_reason = 'translation_not_approved'
  elif (not doc.current_revision):
   fallback_reason = 'no_content'
 except Document.DoesNotExist:
  pass
 return (doc, fallback_reason)

def _get_doc_and_fallback_reason ( document_locale , document_slug ) : doc = None fallback_reason = None try : doc = Document . objects . get ( locale = document_locale , slug = document_slug ) if ( ( not doc . current_revision ) and doc . parent and doc . parent . current_revision ) : fallback_reason = 'translation_not_approved' elif ( not doc . current_revision ) : fallback_reason = 'no_content' except Document . DoesNotExist : pass return ( doc , fallback_reason )
attempt to fetch a document at the given locale and slug .