Due to the UNION query in address_list, the assumption that the list of
author"martin f. krafft" <madduck@debian.org>
Tue, 07 Aug 2012 21:53:41 +0000
changeset 582 605f8c115711
parent 581 9c138471d569
child 583 a479c38931c4
Due to the UNION query in address_list, the assumption that the list of gids received from the database would be continuous does not hold. To prevent addresses for domains with multiple entry types from being listed, it is necessary to check the list of domain gids for every entry. Signed-off-by: martin f. krafft <madduck@debian.org> --- VirtualMailManager/common.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
VirtualMailManager/common.py
--- a/VirtualMailManager/common.py	Sun Jul 29 16:44:20 2012 +0000
+++ b/VirtualMailManager/common.py	Tue Aug 07 21:53:41 2012 +0000
@@ -250,11 +250,9 @@
 
     gids = []
     daddrs = {}
-    lastgid = None
     for gid, address, addrtype, aliasdomain in result:
-        if gid != lastgid:
+        if gid not in gids:
             gids.append(gid)
-            lastgid = gid
             daddrs[gid] = []
         daddrs[gid].append((address, addrtype, aliasdomain))
     return gids, daddrs