From 2345b8d90bbf682a259a0970587408a2d825551f Mon Sep 17 00:00:00 2001 From: zPlus Date: Wed, 10 Aug 2022 06:39:37 +0200 Subject: [PATCH] fix: Duplicated mail lists filters Only show mailing-list filters once; avoid duplicate names. --- templates/mailing_list/emails.html | 4 ++-- web.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/mailing_list/emails.html b/templates/mailing_list/emails.html index 84cc3d9..0214e3a 100644 --- a/templates/mailing_list/emails.html +++ b/templates/mailing_list/emails.html @@ -8,10 +8,10 @@ Filters
- {% for tag in tags %} + {% for tag in tags.keys()|sort %}
{{ tag }}: - {% for value in tags[tag] %} + {% for value in tags[tag]|sort %} {% endfor %}
diff --git a/web.py b/web.py index eae3fc6..d3c7cbd 100644 --- a/web.py +++ b/web.py @@ -777,15 +777,14 @@ def threads(repository): thread_date, thread_time, thread_id, thread_title = obj.name.split(' ', 3) - thread_tags = {} try: thread_tags = parse_thread_tags(obj['tags'].data.decode('UTF-8')) # Collect tags for filters for k, v in thread_tags.items(): - tags[k] = tags.get(k, []) + v + tags[k] = tags.get(k, set()).union(v) except: - pass + thread_tags = {} # Check if we should filter out this thread from the list keep = True