Not tested, but "if get_payee_and_account(entry) is not None:" would sound more pythonic