def remove_role(self, user, assignee, role):
        """
        Removes the role from the assignee. The 'user' argument is used for
        logging purposes.
        """
        try:
            p_as_user = Participant.objects.get(workflowactivity=self, 
                        user=user, disabled=False)
            p_as_assignee = Participant.objects.get(workflowactivity=self, 
                    user=assignee)
            if role in p_as_assignee.roles.all():
                p_as_assignee.roles.remove(role)
                name = assignee.get_full_name() if assignee.get_full_name() else assignee.username
                note = _('Role "%s" removed from %s')%(role.__unicode__(), name)
                current_state = self.current_state().state if self.current_state() else None
                deadline = self.current_state().deadline if self.current_state() else None
                wh = WorkflowHistory(
                        workflowactivity=self,
                        state=current_state,
                        log_type=WorkflowHistory.ROLE,
                        participant=p_as_user,
                        note=note,
                        deadline=deadline
                        )
                wh.save()
                role_removed.send(sender=wh)
                return wh
            else:
                # The role isn't associated with the assignee anyway so there is
                # nothing to do
                return None
        except __HOLE__:
            # If we can't find the assignee as a participant then there is 
            # nothing to do
            return None
dataset/ETHPy150Open ntoll/workflow/workflow/models.py/WorkflowActivity.remove_role