def draft_context(cls):
        """Set the context to draft"""
        previous_state = g.get('draft')
        try:
            g.draft = True
            yield
        finally:
            g.draft = previous_state
Set the context to draft