def delete(self, request, *args, **kwargs):
        try:
            node, user = self.get_object()
            if node.remove_contributor(user, None, log=False):
                update_admin_log(
                    user_id=self.request.user.id,
                    object_id=node.pk,
                    object_repr='Contributor',
                    message='User {} removed from node {}.'.format(
                        user.pk, node.pk
                    ),
                    action_flag=CONTRIBUTOR_REMOVED
                )
                # Log invisibly on the OSF.
                osf_log = NodeLog(
                    action=NodeLog.CONTRIB_REMOVED,
                    user=None,
                    params={
                        'project': node.parent_id,
                        'node': node.pk,
                        'contributors': user.pk
                    },
                    date=datetime.utcnow(),
                    should_hide=True,
                )
                osf_log.save()
        except __HOLE__:
            return page_not_found(
                request,
                AttributeError(
                    '{} with id "{}" not found.'.format(
                        self.context_object_name.title(),
                        kwargs.get('node_id')
                    )
                )
            )
        return redirect(reverse_node(self.kwargs.get('node_id')))
dataset/ETHPy150Open CenterForOpenScience/osf.io/admin/nodes/views.py/NodeRemoveContributorView.delete