If an alias has multiple destinations, multiple records exist, due to
author"martin f. krafft" <madduck@debian.org>
Tue, 07 Aug 2012 21:54:39 +0000
changeset 583 a479c38931c4
parent 582 605f8c115711
child 584 f9a2327f57a6
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(-)
VirtualMailManager/common.py
--- 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 '