diff --git a/accountant/models/operations.py b/accountant/models/operations.py index 07326fc..e85ae92 100644 --- a/accountant/models/operations.py +++ b/accountant/models/operations.py @@ -149,7 +149,7 @@ class Operation(db.Model): @classmethod def get_categories_for_range(cls, account, begin, end): """Get category list for a specific time period.""" - if isinstance(account, int) or isinstance(account, str): + if isinstance(account, (int, str)): account_id = account else: account_id = account.id @@ -182,7 +182,7 @@ class Operation(db.Model): @classmethod def get_ohlc_per_day_for_range(cls, account, begin=None, end=None): """Get Opening, High, Low, Closing per day for a specific range""" - if isinstance(account, int) or isinstance(account, str): + if isinstance(account, (int, str)): account_id = account else: account_id = account.id