(self, user)
add the user to a specified group
add the user to a specified group
add the user to a specified group
def add_group_info(self, user):
        '''add the user to a specified group'''
        if not self.groups:
            default_groups = self.get_default_groups()
            self.groups.update(default_groups)


        # add a group
        skipped_connects = user.remove_all_groups(except_list=self.groups)
        skipped_group_names = [ x.get_value('login_group') for x in skipped_connects ]
        for group in self.groups:
            #print "user: ", user.get_value("login")
            if not isinstance(group, basestring): 
                group_name = group.get_value('login_group')
            else:
                group_name = group
            #print "adding to: ", group_name
            if group_name in skipped_group_names:
                continue
            user.add_to_group(group)
def add_group_info ( self , user ) : if not self . groups : default_groups = self . get_default_groups ( ) self . groups . update ( default_groups ) # add a group skipped_connects = user . remove_all_groups ( except_list = self . groups ) skipped_group_names = [ x . get_value ( 'login_group' ) for x in skipped_connects ] for group in self . groups : #print "user: ", user.get_value("login") if not isinstance ( group , basestring ) : group_name = group . get_value ( 'login_group' ) else : group_name = group #print "adding to: ", group_name if group_name in skipped_group_names : continue user . add_to_group ( group )