(core) Fix changing type of source column from choice to choicelist

Summary: Updates the summary column type correctly, rebuilds the table model

Test Plan: Added a python unit test, tested manually in browser

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2973
This commit is contained in:
Alex Hall
2021-08-11 19:45:24 +02:00
parent ba1e919d39
commit 0d1a285129
4 changed files with 100 additions and 7 deletions

View File

@@ -341,6 +341,9 @@ class Table(object):
_updateSummary.is_private = True
col_id = summary_table._summary_helper_col_id
if self.has_column(col_id):
# Column type may have changed, replace completely
self.delete_column(self.get_column(col_id))
col_obj = self._create_or_update_col(col_id, _updateSummary)
self._special_cols[col_id] = col_obj
self.all_columns[col_id] = col_obj