[services] rename register_user kwargs to cwuserkwargs
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 23 Apr 2014 18:16:46 +0200
changeset 9690 2b506822ca54
parent 9689 9e4a3c8719a7
child 9691 b9ca1551f14b
[services] rename register_user kwargs to cwuserkwargs They're attributes/relations for the created CWUser, this makes it clearer.
sobjects/services.py
--- a/sobjects/services.py	Tue Apr 22 15:18:04 2014 +0200
+++ b/sobjects/services.py	Wed Apr 23 18:16:46 2014 +0200
@@ -114,13 +114,13 @@
         cnx.call_service('register_user',
                          login=login,
                          password=password,
-                         **kwargs)
+                         **cwuserkwargs)
     """
     __regid__ = 'register_user'
     __select__ = Service.__select__ & match_kwargs('login', 'password')
     default_groups = ('users',)
 
-    def call(self, login, password, email=None, groups=None, **kwargs):
+    def call(self, login, password, email=None, groups=None, **cwuserkwargs):
         cnx = self._cw
         errmsg = cnx._('the value "%s" is already used, use another one')
 
@@ -134,10 +134,10 @@
         if isinstance(password, unicode):
             # password should *always* be utf8 encoded
             password = password.encode('UTF8')
-        kwargs['login'] = login
-        kwargs['upassword'] = password
+        cwuserkwargs['login'] = login
+        cwuserkwargs['upassword'] = password
         # we have to create the user
-        user = cnx.create_entity('CWUser', **kwargs)
+        user = cnx.create_entity('CWUser', **cwuserkwargs)
         if groups is None:
             groups = self.default_groups
         group_names = ', '.join('%r' % group for group in groups)