From 361ad3d1804aa0e90e10fcb8253d371e9f75db4e Mon Sep 17 00:00:00 2001 From: basteks Date: Tue, 28 Oct 2025 11:38:31 +0100 Subject: [PATCH] Prevent from switching to link column type --- seatable_api/api_gateway.py | 2 ++ seatable_api/main.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/seatable_api/api_gateway.py b/seatable_api/api_gateway.py index 65523e3..269136a 100644 --- a/seatable_api/api_gateway.py +++ b/seatable_api/api_gateway.py @@ -675,6 +675,8 @@ def modify_column_type(self, table_name, column_key, new_column_type): """ if new_column_type not in ColumnTypes: raise ValueError("type %s invalid!" % (new_column_type,)) + if new_column_type == ColumnTypes.LINK: + raise ValueError("Switching to link column type is not allowed!") url = self._column_server_url() json_data = { 'op_type': MODIFY_COLUMN_TYPE, diff --git a/seatable_api/main.py b/seatable_api/main.py index 24aeb2f..51aaf18 100644 --- a/seatable_api/main.py +++ b/seatable_api/main.py @@ -914,6 +914,8 @@ def modify_column_type(self, table_name, column_key, new_column_type): """ if new_column_type not in ColumnTypes: raise ValueError("type %s invalid!" % (new_column_type,)) + if new_column_type == ColumnTypes.LINK: + raise ValueError("Switching to link column type is not allowed!") url = self._column_server_url() json_data = { 'op_type': MODIFY_COLUMN_TYPE,