return success or not on creation of user
authorArthur Lutz <arthur.lutz@logilab.fr>
Wed, 11 Feb 2009 14:46:26 +0100
changeset 594 76218d42d21f
parent 593 6f6549780096
child 595 178fc96fd148
return success or not on creation of user
server/repository.py
--- a/server/repository.py	Tue Feb 10 18:12:43 2009 +0100
+++ b/server/repository.py	Wed Feb 11 14:46:26 2009 +0100
@@ -490,7 +490,7 @@
         session = self.internal_session()
         try:
             if session.execute('EUser X WHERE X login %(login)s', {'login': login}):
-                return
+                return False
             # we have to create the user
             user = self.vreg.etype_class('EUser')(session, None)
             if isinstance(password, unicode):
@@ -505,6 +505,7 @@
             session.commit()
         finally:
             session.close()
+        return True
         
     def connect(self, login, password, cnxprops=None):
         """open a connection for a given user