If an alias has multiple destinations, multiple records exist, due to
the nature of the database. address_list would then return the same
alias multiple times, which does not add any information, eats screen
space and is potentially confusing.
Therefore, we SELECT DISTINCTly from the alias table.
Signed-off-by: martin f. krafft <madduck@debian.org>
---
VirtualMailManager/common.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/VirtualMailManager/common.py Tue Aug 07 21:53:41 2012 +0000
+++ b/VirtualMailManager/common.py Tue Aug 07 21:54:39 2012 +0000
@@ -221,7 +221,7 @@
queries.append('SELECT gid, local_part, %d AS type FROM users'
% TYPE_ACCOUNT)
if typelimit & TYPE_ALIAS:
- queries.append('SELECT gid, address as local_part, %d AS type '
+ queries.append('SELECT DISTINCT gid, address as local_part, %d AS type '
'FROM alias' % TYPE_ALIAS)
if typelimit & TYPE_RELOCATED:
queries.append('SELECT gid, address as local_part, %d AS type '