server/serverctl.py
changeset 4845 dc351b96f596
parent 4831 c5aec27c1bf7
parent 4837 54969eec48eb
child 4848 41f84eea63c9
--- a/server/serverctl.py	Tue Mar 09 11:01:44 2010 +0100
+++ b/server/serverctl.py	Tue Mar 09 11:05:29 2010 +0100
@@ -66,7 +66,13 @@
     cnx = get_connection(driver, dbhost, dbname, user, password=password,
                          port=source.get('db-port'),
                          **extra)
-    cnx.logged_user = logged_user
+    try:
+        cnx.logged_user = user
+    except AttributeError:
+        # C object, __slots__
+        from logilab.db import _SimpleConnectionWrapper
+        cnx = _SimpleConnectionWrapper(cnx)
+        cnx.logged_user = user
     return cnx
 
 def system_source_cnx(source, dbms_system_base=False,