code: def get_publication(request):
      
      publication_id = request.matchdict['id']
      state, messages = check_publication_state(publication_id)
      response_data = {
          'publication': publication_id,
          'state': state,
          'messages': messages,
      }
      return response_data
docs: Lookup publication state