[repo] don't need rset description on those queries stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 30 Mar 2010 11:15:57 +0200
branchstable
changeset 5073 a9697325cffa
parent 5072 072ae171aeb0
child 5074 bc481dab93d4
[repo] don't need rset description on those queries
server/repository.py
--- a/server/repository.py	Tue Mar 30 11:15:08 2010 +0200
+++ b/server/repository.py	Tue Mar 30 11:15:57 2010 +0200
@@ -366,7 +366,8 @@
         session = self.internal_session()
         try:
             rset = session.execute('Any L WHERE U login L, U primary_email M, '
-                                   'M address %(login)s', {'login': login})
+                                   'M address %(login)s', {'login': login},
+                                   build_descr=False)
             if rset.rowcount == 1:
                 login = rset[0][0]
         finally:
@@ -498,9 +499,10 @@
         # for consistency, keep same error as unique check hook (although not required)
         errmsg = session._('the value "%s" is already used, use another one')
         try:
-            if (session.execute('CWUser X WHERE X login %(login)s', {'login': login})
+            if (session.execute('CWUser X WHERE X login %(login)s', {'login': login},
+                                build_descr=False)
                 or session.execute('CWUser X WHERE X use_email C, C address %(login)s',
-                                   {'login': login})):
+                                   {'login': login}, build_descr=False)):
                 qname = role_name('login', 'subject')
                 raise ValidationError(None, {qname: errmsg % login})
             # we have to create the user
@@ -516,12 +518,13 @@
                             {'x': user.eid})
             if email or '@' in login:
                 d = {'login': login, 'email': email or login}
-                if session.execute('EmailAddress X WHERE X address %(email)s', d):
+                if session.execute('EmailAddress X WHERE X address %(email)s', d,
+                                   build_descr=False):
                     qname = role_name('address', 'subject')
                     raise ValidationError(None, {qname: errmsg % d['email']})
                 session.execute('INSERT EmailAddress X: X address %(email)s, '
                                 'U primary_email X, U use_email X '
-                                'WHERE U login %(login)s', d)
+                                'WHERE U login %(login)s', d, build_descr=False)
             session.commit()
         finally:
             session.close()