From ee599ddc2ed32dac9747d71f65488db3a0e002b1 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 17 Sep 2024 21:31:11 -0600 Subject: [PATCH] sort inbox --- server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index d135fdd..ed2bb41 100644 --- a/server.py +++ b/server.py @@ -9,6 +9,8 @@ import magic from flask import Flask, render_template, send_from_directory, abort from flask_httpauth import HTTPBasicAuth +# TODO: display inline attachments in the attachments section + app = Flask(__name__) if not os.environ.get('HTTP_AUTH_PASS'): @@ -50,7 +52,7 @@ def account(email_account): conn = get_db_connection(email_account) if not conn: 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() conn.close() syncs = [dict_from_row(sync) for sync in syncs]