06/05 Optimize app

This commit is contained in:
2026-06-05 09:29:41 -04:00
parent deba20cf7e
commit 8481e9c214
5 changed files with 201 additions and 67 deletions
+7 -2
View File
@@ -214,13 +214,15 @@ def sync_preview_view(teller_account_id):
session['teller_account_id'] = teller_account_id
from app.models.category import Category
cat_map = {c.id: c.name for c in Category.query.filter_by(is_active=True).all()}
cats = Category.query.filter_by(is_active=True).order_by(Category.name).all()
cat_map = {c.id: c.name for c in cats}
return render_template('teller/preview.html',
ta=ta,
preview=preview,
count=len(preview),
cat_map=cat_map)
cat_map=cat_map,
categories=cats)
@teller_bp.route('/sync/confirm', methods=['POST'])
@@ -256,6 +258,9 @@ def sync_confirm():
override = request.form.get(f'type_{r["teller_id"]}')
if override in ('income', 'expense'):
r['transaction_type'] = override
cat_override = request.form.get(f'category_{r["teller_id"]}', '')
if cat_override.isdigit():
r['category_id'] = int(cat_override)
parsed.append(r)
if not parsed: