06/03 Optimize codes, move account action buttons to Accounts page

This commit is contained in:
2026-06-03 10:21:14 -04:00
parent daeea836d0
commit 395a2d9535
4 changed files with 132 additions and 135 deletions
+10 -1
View File
@@ -83,12 +83,21 @@ def index():
).group_by(Transaction.account_id).all()
monthly_charges = {row[0]: float(row[1]) for row in rows}
# Teller account mapping: pfm_account_id → TellerAccount
from app.models.teller_enrollment import TellerAccount
teller_accounts = TellerAccount.query.filter(
TellerAccount.pfm_account_id.in_([a.id for a in all_accounts]),
TellerAccount.is_active == True,
).all()
teller_map = {ta.pfm_account_id: ta for ta in teller_accounts}
return render_template('accounts/index.html',
accounts=accounts,
tab=tab,
bank_count=len(bank_accounts),
credit_count=len(credit_accounts),
monthly_charges=monthly_charges)
monthly_charges=monthly_charges,
teller_map=teller_map)
@accounts_bp.route('/new', methods=['GET', 'POST'])
+3
View File
@@ -294,6 +294,9 @@ def full_resync(teller_account_id):
f'Next sync will fetch the last 90 days — duplicates will be skipped automatically.',
'info'
)
next_url = request.form.get('next', '')
if next_url and next_url.startswith('/'):
return redirect(next_url)
return redirect(url_for('teller.index'))