'Attempt to schedule rendering. Honor the deferred_rendering field to
decide between an immediate or a queued render.'

def schedule_rendering(self, cache_control=None, base_url=None):

    if settings.MAINTENANCE_MODE:
        return
    if (self.is_rendering_scheduled or self.is_rendering_in_progress):
        return
    now = datetime.now()
    Document.objects.filter(pk=self.pk).update(render_scheduled_at=now)
    self.render_scheduled_at = now
    if (waffle.switch_is_active('wiki_force_immediate_rendering') or (not self.defer_rendering)):
        self.render(cache_control, base_url)
    else:
        from . import tasks
        tasks.render_document.delay(self.pk, cache_control, base_url)
