original_docstring: 
      Checks that the session associated with the request is authenticated
      
docstring: Checks that the session associated with the request is authenticated
docstring_tokens: Checks that the session associated with the request is authenticated
code: def check_authentication_helper(r: Request):
      """
      Checks that the session associated with the request is authenticated
      """
      # Don't authenticate in local mode, since session cookies will not be
      # included in request/response headers without HTTPS
      if settings.LOCAL_MODE:
          return
  
      if not r.session.get("authenticated"):
          raise ValueError(_("Session is not authenticated"))
  
      transaction_qs = Transaction.objects.filter(
          id=r.GET.get("transaction_id"), stellar_account=r.session.get("account")
      )
      if not transaction_qs.exists():
          raise ValueError(_("Transaction for account not found"))
code_tokens: def check_authentication_helper ( r : Request ) : if settings . LOCAL_MODE : return if not r . session . get ( "authenticated" ) : raise ValueError ( _ ( "Session is not authenticated" ) ) transaction_qs = Transaction . objects . filter ( id = r . GET . get ( "transaction_id" ) , stellar_account = r . session . get ( "account" ) ) if not transaction_qs . exists ( ) : raise ValueError ( _ ( "Transaction for account not found" ) )
short_docstring: Checks that the session associated with the request is authenticated
short_docstring_tokens: Checks that the session associated with the request is authenticated
comment: """
      Checks that the session associated with the request is authenticated
      """$SEP$# Don't authenticate in local mode, since session cookies will not be$SEP$# included in request/response headers without HTTPS