[services] catch missing group early in register_user
Better an assertion than a rql syntax error for such a programming error.
--- a/sobjects/services.py Wed Apr 23 18:16:46 2014 +0200
+++ b/sobjects/services.py Wed Apr 23 18:17:42 2014 +0200
@@ -140,6 +140,7 @@
user = cnx.create_entity('CWUser', **cwuserkwargs)
if groups is None:
groups = self.default_groups
+ assert groups, "CWUsers must belong to at least one CWGroup"
group_names = ', '.join('%r' % group for group in groups)
cnx.execute('SET X in_group G WHERE X eid %%(x)s, G name IN (%s)' % group_names,
{'x': user.eid})