From 020f6a761dbb57c5a0c3669698e44c4e9b5ba758 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 26 Aug 2011 10:14:33 +0200 Subject: [PATCH] Columns must be restored each time a new instance of SQLlisting is created. (static member issue) see #155 --- extensions/amavis_quarantine/sql_listing.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/amavis_quarantine/sql_listing.py b/extensions/amavis_quarantine/sql_listing.py index 3a9cf9295..80db37aad 100644 --- a/extensions/amavis_quarantine/sql_listing.py +++ b/extensions/amavis_quarantine/sql_listing.py @@ -22,7 +22,7 @@ class Qtable(tables.Table): time = tables.Column("date", label=_("Date")) to = tables.Column("to", label=_("To"), sortable=False) - cols_order = ['type', 'rstatus', 'to', 'from_', 'subject', 'time'] + cols_order = [] def parse_date(self, value): return datetime.fromtimestamp(value) @@ -84,10 +84,9 @@ class SQLlisting(EmailListing): def __init__(self, user, msgs, filter, **kwargs): if not user.is_superuser and not is_domain_admin(user): - try: - Qtable.cols_order.remove('to') - except ValueError: - pass + Qtable.cols_order = ['type', 'rstatus', 'from_', 'subject', 'time'] + else: + Qtable.cols_order = ['type', 'rstatus', 'to', 'from_', 'subject', 'time'] self.mbc = SQLconnector(msgs, filter) super(SQLlisting, self).__init__(**kwargs)