From b3ffd97a0b433647a53ecd7a5cc63f7bdc1e1ee2 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Wed, 4 Dec 2013 10:51:20 +0100 Subject: Add a config option to only display lists from the same virtual host --- hyperkitty/lib/view_helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hyperkitty/lib/view_helpers.py') diff --git a/hyperkitty/lib/view_helpers.py b/hyperkitty/lib/view_helpers.py index fb8e897..283c1e3 100644 --- a/hyperkitty/lib/view_helpers.py +++ b/hyperkitty/lib/view_helpers.py @@ -156,3 +156,10 @@ def get_recent_list_activity(store, mlist): # return the proper format for the javascript chart function return [ {"date": d, "count": emails_per_date[d]} for d in sorted(emails_per_date) ] + + +def show_mlist(mlist, request): + def get_domain(host): + return ".".join(host.split(".")[-2:]) + return (get_domain(mlist.name.partition("@")[2]) + == get_domain(request.get_host())) -- cgit