def get_account(account_name): """ Return the account from the database if it exists, or None. """ try: return Account.get(Account.name == account_name) except Account.DoesNotExist: LOG.warning("No account with that name: " + account_name) return None