code: def get_object(self):
          
          obj = super(PublishActionView, self).get_object()
  
          if obj:
              if not hasattr(obj, 'publish'):
                  raise http.Http404
  
          return obj
docs: Get the object for publishing
          Raises a http404 error if the object is not found.