VirtualMailManager/account.py
branchv0.6.x
changeset 561 b0165b7af7a3
parent 560 2662f4e17eb4
child 568 14abdd04ddf5
--- a/VirtualMailManager/account.py	Wed Jun 27 12:46:27 2012 +0000
+++ b/VirtualMailManager/account.py	Wed Jun 27 13:11:28 2012 +0000
@@ -251,15 +251,22 @@
         self._prepare(MailLocation(self._dbh, mbfmt=cfg_dget('mailbox.format'),
                                    directory=cfg_dget('mailbox.root')))
         dbc = self._dbh.cursor()
+        qid = ssid = tid = None
+        if self._qlimit:
+            qid = self._qlimit.qid
+        if self._services:
+            ssid = self._services.ssid
+        if self._transport:
+            tid = self._transport.tid
         dbc.execute('INSERT INTO users (local_part, passwd, uid, gid, mid, '
                     'qid, ssid, tid, note) '
                     'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)',
                     (self._addr.localpart,
                      pwhash(self._passwd, user=self._addr), self._uid,
-                     self._domain.gid, self._mail.mid,
-                     self._qlimit.qid if self._qlimit else None,
-                     self._services.ssid if self._services else None,
-                     self._transport.tid if self._transport else None,
+                     self._domain.gid, self._mail.mid, qid, ssid, tid,
+#                     self._qlimit.qid if self._qlimit else None,
+#                     self._services.ssid if self._services else None,
+#                     self._transport.tid if self._transport else None,
                      self._note))
         self._dbh.commit()
         dbc.close()