Beispiel #1
0
    def handle(self, request, data):

        try:

            selected_members =  data.get('members',None)
            group_name = data.get('group_name',None)

            
            for member in selected_members:

                member_info = get_member(member)

                current_member_groups = member_info.member_group_names

                current_member_groups.append(group_name)
                
                update_member(member_name=member,member_type=str(member_info.member_type),member_group_names=current_member_groups)


            return True



        except Exception:

            response = exceptions.handle(request, ignore=True)

            messages.error(request, _('Unable to update member'))
Beispiel #2
0
    def delete(self, request, obj_id):

        group_name=self.table.kwargs.get('group_name',None)

        if group_name !=None:
            member_info = get_member(obj_id) 
            current_member_groups = member_info.member_group_names
            current_member_groups.remove(group_name)
            update_member(member_name=obj_id,member_type=str(member_info.member_type),member_group_names=current_member_groups)
            return None
            
            
        remove_member(obj_id)
Beispiel #3
0
    def handle(self, request, data):

        print '<< update_member handle'

        try:


            member_name=data['id']
            member_groups=data['membergroups']
            member_type=data['member_types']
            result = update_member(member_name=member_name,member_type=member_type,member_group_names=member_groups)
      
            print "====" 
            print result
            print "===="
        
            return True


        except Exception:

            response = exceptions.handle(request, ignore=True)

            messages.error(request, _('Unable to update member'))