VirtualMailManager/account.py
changeset 661 29295afafa91
parent 614 1ec3497a6733
child 662 9ec7770193ad
child 675 d24f094d1cb5
equal deleted inserted replaced
646:86c2ed36aba8 661:29295afafa91
   438         if not isinstance(force, bool):
   438         if not isinstance(force, bool):
   439             raise TypeError('force must be a bool')
   439             raise TypeError('force must be a bool')
   440         self._chk_state()
   440         self._chk_state()
   441         dbc = self._dbh.cursor()
   441         dbc = self._dbh.cursor()
   442         if force:
   442         if force:
   443             dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid),)
   443             dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid,))
   444             # delete also all aliases where the destination address is the same
   444             # delete also all aliases where the destination address is the same
   445             # as for this account.
   445             # as for this account.
   446             dbc.execute("DELETE FROM alias WHERE destination = %s",
   446             dbc.execute("DELETE FROM alias WHERE destination = %s",
   447                         (str(self._addr),))
   447                         (str(self._addr),))
   448             self._dbh.commit()
   448             self._dbh.commit()