code style
This commit is contained in:
parent
a9de27fdef
commit
38416fc6d7
2 changed files with 8 additions and 10 deletions
|
@ -22,11 +22,10 @@ def _get_asset_accounts():
|
||||||
).json()
|
).json()
|
||||||
accounts.extend(accounts_json.get('data'))
|
accounts.extend(accounts_json.get('data'))
|
||||||
|
|
||||||
asset_accounts = []
|
return (
|
||||||
for account in accounts:
|
asset_account for asset_account in accounts
|
||||||
if account.get('attributes').get('type') == "asset":
|
if asset_account.get('attributes').get('type') == 'asset'
|
||||||
asset_accounts.append(account)
|
)
|
||||||
return asset_accounts
|
|
||||||
|
|
||||||
|
|
||||||
def get_account_metrics():
|
def get_account_metrics():
|
||||||
|
|
|
@ -35,12 +35,11 @@ def _get_current_limit(budget_id):
|
||||||
).json()
|
).json()
|
||||||
budgets.extend(budget_json.get('data'))
|
budgets.extend(budget_json.get('data'))
|
||||||
|
|
||||||
current_budgets = []
|
|
||||||
today = datetime.datetime.today()
|
today = datetime.datetime.today()
|
||||||
for budget in budgets:
|
return [
|
||||||
if today > dateutil.parser.parse(budget.get('attributes').get('start')) and today < dateutil.parser.parse(budget.get('attributes').get('end')):
|
budget for budget in budgets
|
||||||
current_budgets.append(budget)
|
if today > dateutil.parser.parse(budget.get('attributes').get('start')) and today < dateutil.parser.parse(budget.get('attributes').get('end'))
|
||||||
return current_budgets[0]
|
][0]
|
||||||
|
|
||||||
|
|
||||||
def _get_current_transactions(budget_id):
|
def _get_current_transactions(budget_id):
|
||||||
|
|
Loading…
Reference in a new issue