original_docstring: 
          Task handler to push an event out to all necessary channels
      
docstring: Task handler to push an event out to all necessary channels
docstring_tokens: Task handler to push an event out to all necessary channels
code: def publish_event_task_handler(request, event_id=None):
      """
          Task handler to push an event out to all necessary channels
      """
      event, model = get_event(event_id)
  
      if not event:
          raise Http404
  
      if model:
          model_dict = get_model_message(event, model)
      else:
          model_dict = None
  
      if event.video_id:
          channel = "videoid-{0}".format(event.video_id)
      elif event.project_id:
          # only publish project messages if there isn't a video ID
          channel = "projectid-{0}".format(event.project_id)
      else:
          channel = "generic"
  
      manager = GreendayChannelManager(channels=[channel])
  
      manager.publish_message({
          "event": event.to_dict(),
          "model": model_dict
      })
  
      return HttpResponse()
code_tokens: def publish_event_task_handler ( request , event_id = None ) : event , model = get_event ( event_id ) if not event : raise Http404 if model : model_dict = get_model_message ( event , model ) else : model_dict = None if event . video_id : channel = "videoid-{0}" . format ( event . video_id ) elif event . project_id : channel = "projectid-{0}" . format ( event . project_id ) else : channel = "generic" manager = GreendayChannelManager ( channels = [ channel ] ) manager . publish_message ( { "event" : event . to_dict ( ) , "model" : model_dict } ) return HttpResponse ( )
short_docstring: Task handler to push an event out to all necessary channels
short_docstring_tokens: Task handler to push an event out to all necessary channels
comment: """
          Task handler to push an event out to all necessary channels
      """$SEP$# only publish project messages if there isn't a video ID