From c1f571a4c342bc45714123a08a479feeac72655a Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Mon, 31 Oct 2022 08:48:55 +0100 Subject: [PATCH] Speed things up. If we want to go further than this we should change podop's incr(), pass the flags and make admin process the results. --- core/admin/mailu/internal/views/dovecot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/admin/mailu/internal/views/dovecot.py b/core/admin/mailu/internal/views/dovecot.py index 10f3d5fb..783a14f4 100644 --- a/core/admin/mailu/internal/views/dovecot.py +++ b/core/admin/mailu/internal/views/dovecot.py @@ -27,9 +27,9 @@ def dovecot_userdb_dict_list(): @internal.route("/dovecot/userdb/") def dovecot_userdb_dict(user_email): - user = models.User.query.get(user_email) or flask.abort(404) + quota = models.User.query.filter(models.User.email==email).with_entities(models.User.quota_bytes).one_or_none() or flask.abort(404) return flask.jsonify({ - "quota_rule": "*:bytes={}".format(user.quota_bytes) + "quota_rule": "*:bytes="+quota[0]) })