VMM/alias: Load destination addresses sorted.
authorPascal Volk <user@localhost.localdomain.org>
Thu, 27 Sep 2012 20:03:05 +0000
changeset 619 4ec5c015b7aa
parent 618 d8736bb80bdc
child 620 ca882a1ff90b
VMM/alias: Load destination addresses sorted. This produces sorted output for the aliasinfo subcommand.
VirtualMailManager/alias.py
--- a/VirtualMailManager/alias.py	Thu Sep 27 19:15:09 2012 +0000
+++ b/VirtualMailManager/alias.py	Thu Sep 27 20:03:05 2012 +0000
@@ -42,7 +42,8 @@
         """Loads all known destination addresses into the _dests list."""
         dbc = self._dbh.cursor()
         dbc.execute('SELECT destination FROM alias WHERE gid = %s AND '
-                    'address = %s', (self._gid, self._addr.localpart))
+                    'address = %s ORDER BY destination',
+                    (self._gid, self._addr.localpart))
         dests = dbc.fetchall()
         if dbc.rowcount > 0:
             self._dests.extend(DestAddr(dest[0], self._dbh) for dest in dests)