VirtualMailManager/account.py
branchv0.7.x
changeset 662 9ec7770193ad
parent 643 df1e3b67882a
parent 661 29295afafa91
child 670 f374ef062c94
equal deleted inserted replaced
660:0bce7e1d1349 662:9ec7770193ad
   427         if not isinstance(force, bool):
   427         if not isinstance(force, bool):
   428             raise TypeError('force must be a bool')
   428             raise TypeError('force must be a bool')
   429         self._chk_state()
   429         self._chk_state()
   430         dbc = self._dbh.cursor()
   430         dbc = self._dbh.cursor()
   431         if force:
   431         if force:
   432             dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid),)
   432             dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid,))
   433             # delete also all aliases where the destination address is the same
   433             # delete also all aliases where the destination address is the same
   434             # as for this account.
   434             # as for this account.
   435             dbc.execute("DELETE FROM alias WHERE destination = %s",
   435             dbc.execute("DELETE FROM alias WHERE destination = %s",
   436                         (str(self._addr),))
   436                         (str(self._addr),))
   437             self._dbh.commit()
   437             self._dbh.commit()