Skip to content

Commit b52db1b

Browse files
authored
Merge pull request #108 from seatable/Prevent-modifying-column-to-link-type
Prevent from switching to link column type fixes #107
2 parents 667868d + 361ad3d commit b52db1b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

seatable_api/api_gateway.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ def modify_column_type(self, table_name, column_key, new_column_type):
675675
"""
676676
if new_column_type not in ColumnTypes:
677677
raise ValueError("type %s invalid!" % (new_column_type,))
678+
if new_column_type == ColumnTypes.LINK:
679+
raise ValueError("Switching to link column type is not allowed!")
678680
url = self._column_server_url()
679681
json_data = {
680682
'op_type': MODIFY_COLUMN_TYPE,

seatable_api/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ def modify_column_type(self, table_name, column_key, new_column_type):
914914
"""
915915
if new_column_type not in ColumnTypes:
916916
raise ValueError("type %s invalid!" % (new_column_type,))
917+
if new_column_type == ColumnTypes.LINK:
918+
raise ValueError("Switching to link column type is not allowed!")
917919
url = self._column_server_url()
918920
json_data = {
919921
'op_type': MODIFY_COLUMN_TYPE,

0 commit comments

Comments
 (0)