sort inbox

This commit is contained in:
Cyberes 2024-09-17 21:31:11 -06:00
parent 3b0b500cad
commit ee599ddc2e
1 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,8 @@ import magic
from flask import Flask, render_template, send_from_directory, abort from flask import Flask, render_template, send_from_directory, abort
from flask_httpauth import HTTPBasicAuth from flask_httpauth import HTTPBasicAuth
# TODO: display inline attachments in the attachments section
app = Flask(__name__) app = Flask(__name__)
if not os.environ.get('HTTP_AUTH_PASS'): if not os.environ.get('HTTP_AUTH_PASS'):
@ -50,7 +52,7 @@ def account(email_account):
conn = get_db_connection(email_account) conn = get_db_connection(email_account)
if not conn: if not conn:
abort(404) abort(404)
folders = conn.execute('SELECT name, table_name FROM folders_mapping').fetchall() folders = sorted(conn.execute('SELECT name, table_name FROM folders_mapping').fetchall(), key=lambda d: d['name'])
syncs = conn.execute('SELECT * FROM syncs ORDER BY timestamp DESC').fetchall() syncs = conn.execute('SELECT * FROM syncs ORDER BY timestamp DESC').fetchall()
conn.close() conn.close()
syncs = [dict_from_row(sync) for sync in syncs] syncs = [dict_from_row(sync) for sync in syncs]