예제 #1
0
 def emit_app_preview_event(self, preview_file_id):
     """
     Emit an event, each time a preview is added.
     """
     preview_file = files_service.get_preview_file(preview_file_id)
     comment = tasks_service.get_comment_by_preview_file_id(preview_file_id)
     task = tasks_service.get_task(preview_file["task_id"])
     comment_id = None
     if comment is not None:
         comment_id = comment["id"]
         events.emit(
             "comment:update",
             {"comment_id": comment_id},
             project_id=task["project_id"],
         )
         events.emit(
             "preview-file:add-file",
             {
                 "comment_id": comment_id,
                 "task_id": preview_file["task_id"],
                 "preview_file_id": preview_file["id"],
                 "revision": preview_file["revision"],
                 "extension": preview_file["extension"],
                 "status": preview_file["status"],
             },
             project_id=task["project_id"],
         )
예제 #2
0
파일: resources.py 프로젝트: tokejepsen/zou
    def emit_app_preview_event(self, preview_file_id):
        preview_file = files_service.get_preview_file(preview_file_id)
        comment = tasks_service.get_comment_by_preview_file_id(
            preview_file_id
        )
        comment_id = None
        if comment is not None:
            comment_id = comment["id"]

        events.emit("preview:add", {
            "comment_id": comment_id,
            "task_id": preview_file["task_id"],
            "preview": preview_file
        })
예제 #3
0
    def emit_app_preview_event(self, preview_file_id):
        """
        Emit an event, each time a preview is added.
        """
        preview_file = files_service.get_preview_file(preview_file_id)
        comment = tasks_service.get_comment_by_preview_file_id(preview_file_id)
        comment_id = None
        if comment is not None:
            comment_id = comment["id"]

        events.emit(
            "preview:add", {
                "comment_id": comment_id,
                "task_id": preview_file["task_id"],
                "preview_file_id": preview_file["id"],
                "is_movie": preview_file["is_movie"],
                "revision": preview_file["revision"],
                "extension": preview_file["extension"]
            })