'Signal handler to be called when a given user ban is saved.'

def on_ban_save(self, sender, instance, **kwargs):

    instance.user.is_active = (not instance.is_active)
    instance.user.save()
    self.invalidate_document_contribution(instance.user)
