[dbapi] fallback to Entity when etypes registry isn't initialized (weird we haven't catchi this pb before)
--- a/dbapi.py Thu Apr 15 19:39:55 2010 +0200
+++ b/dbapi.py Mon Apr 19 12:42:01 2010 +0200
@@ -560,9 +560,13 @@
if req is None:
req = self.request()
rset = req.eid_rset(eid, 'CWUser')
- user = self.vreg['etypes'].etype_class('CWUser')(req, rset, row=0,
- groups=groups,
- properties=properties)
+ if 'etypes' in self.vreg:
+ user = self.vreg['etypes'].etype_class('CWUser')(req, rset, row=0,
+ groups=groups,
+ properties=properties)
+ else:
+ from cubicweb.entity import Entity
+ user = Entity(req, rset, row=0)
user['login'] = login # cache login
return user