From 8942f528bbe462b1979649a4e4df2407e2b8253a Mon Sep 17 00:00:00 2001 From: Likename Haojie Date: Sat, 26 Oct 2024 01:08:28 +0800 Subject: [PATCH 1/2] Fix the bug where, when file upload is enabled, messages cannot be sent in the chat window after transitioning from the old workflow features structure to the new one. --- api/models/workflow.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/api/models/workflow.py b/api/models/workflow.py index e5fbcaf87e..408c8322b3 100644 --- a/api/models/workflow.py +++ b/api/models/workflow.py @@ -158,19 +158,7 @@ class Workflow(db.Model): return self._features features = json.loads(self._features) - if features.get("file_upload", {}).get("image", {}).get("enabled", False): - image_enabled = True - image_number_limits = int(features["file_upload"]["image"].get("number_limits", 1)) - image_transfer_methods = features["file_upload"]["image"].get( - "transfer_methods", ["remote_url", "local_file"] - ) - features["file_upload"]["enabled"] = image_enabled - features["file_upload"]["number_limits"] = image_number_limits - features["file_upload"]["allowed_upload_methods"] = image_transfer_methods - features["file_upload"]["allowed_file_types"] = ["image"] - features["file_upload"]["allowed_extensions"] = [] - del features["file_upload"]["image"] - self._features = json.dumps(features) + self._features = json.dumps(features) return self._features @features.setter From 09c23c6918071c7eca2944013c566faa2a18f0e3 Mon Sep 17 00:00:00 2001 From: Likename Haojie Date: Sat, 26 Oct 2024 01:22:29 +0800 Subject: [PATCH 2/2] fix-Fix-the-bug-where,-when-file-upload-is-enabled,-messages-cannot-be-sent-in-the-chat-window-after-transitioning-from-the-old-workflow-features-structure-to-the-new-one fix-Fix-the-bug-where,-when-file-upload-is-enabled,-messages-cannot-be-sent-in-the-chat-window-after-transitioning-from-the-old-workflow-features-structure-to-the-new-one --- api/models/workflow.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/api/models/workflow.py b/api/models/workflow.py index 408c8322b3..3415b15bf4 100644 --- a/api/models/workflow.py +++ b/api/models/workflow.py @@ -151,14 +151,6 @@ class Workflow(db.Model): @property def features(self) -> str: - """ - Convert old features structure to new features structure. - """ - if not self._features: - return self._features - - features = json.loads(self._features) - self._features = json.dumps(features) return self._features @features.setter