cubicweb #934935 [hooks] a hook on user to autoset user <-> users group does not work [rejected]

class UserInUsersGroup(Hook):
    __regid__ = 'pylos.autoset_user_in_users_group'
    events = ('after_add_entity',)
    __select__ = Hook.__select__ & implements('CWUser')

    def __call__(self):
        users = self._cw.execute('CWGroup G WHERE G name "users"').get_entity(0,0)
        self._cw.execute('SET U in_group G WHERE U eid %(u)s, G eid %(g)s',
                         {'u': self.entity.eid, 'g': users.eid})
        #self.entity.set_relations(in_group=users)
priorityimportant
typebug
done in3.8.3
load0.000
load left0.000
closed by<not specified>