06/02 Optimize app 2
This commit is contained in:
+19
-1
@@ -119,11 +119,29 @@ def _category_choices(txn_type='expense'):
|
||||
@settings_bp.route('/')
|
||||
@login_required
|
||||
def index():
|
||||
from flask import current_app
|
||||
upcoming = get_upcoming(days=30)
|
||||
rules = RecurringRule.query.filter_by(is_active=True).order_by(RecurringRule.name).all()
|
||||
smtp_ok = all([
|
||||
current_app.config.get('SMTP_HOST'),
|
||||
current_app.config.get('SMTP_USER'),
|
||||
current_app.config.get('SMTP_PASSWORD'),
|
||||
current_app.config.get('ALERT_EMAIL'),
|
||||
])
|
||||
return render_template('settings/index.html',
|
||||
upcoming=upcoming,
|
||||
rules=rules)
|
||||
rules=rules,
|
||||
smtp_ok=smtp_ok,
|
||||
alert_email=current_app.config.get('ALERT_EMAIL', ''))
|
||||
|
||||
|
||||
@settings_bp.route('/recalc-balances', methods=['POST'])
|
||||
@login_required
|
||||
def recalc_balances():
|
||||
from app.services.account_service import recalc_all
|
||||
recalc_all()
|
||||
flash('All account balances recalculated.', 'success')
|
||||
return redirect(url_for('settings.index'))
|
||||
|
||||
|
||||
@settings_bp.route('/profile', methods=['GET', 'POST'])
|
||||
|
||||
Reference in New Issue
Block a user