code: def published_context(cls):
          
          previous_state = g.get('draft')
          try:
              g.draft = False
              yield
          finally:
              g.draft = previous_state
docs: Set the context to published