'Invalidate the contributor list for Documents the user has edited.
This will remove them if they have been banned, and add them if they
have been unbanned.'

def invalidate_document_contribution(self, user):

    from kuma.wiki.jobs import DocumentContributorsJob
    doc_ids = set(user.created_revisions.values_list('document_id', flat=True))
    job = DocumentContributorsJob()
    for doc_id in doc_ids:
        job.invalidate(doc_id)
