(core) Replacing python3 specifc code

Summary: Removing JSONDecodeError type from python code that is python3 only.

Test Plan: Existing

Reviewers: paulfitz, georgegevoian

Reviewed By: paulfitz, georgegevoian

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4298
pull/1112/head
Jarosław Sadziński 2 months ago
parent b5e0e020ef
commit 2868ee2fa1

@ -35,7 +35,7 @@ def perform_dropdown_condition_renames(useractions, renames):
try: try:
widget_options = json.loads(col.widgetOptions) widget_options = json.loads(col.widgetOptions)
dc_formula = widget_options["dropdownCondition"]["text"] dc_formula = widget_options["dropdownCondition"]["text"]
except (json.JSONDecodeError, KeyError): except (ValueError, KeyError):
continue continue
# Find out what table this column refers to and belongs to. # Find out what table this column refers to and belongs to.

@ -708,9 +708,6 @@ class UserActions(object):
for col_rec, new_formula in sorted(six.iteritems(formula_updates)): for col_rec, new_formula in sorted(six.iteritems(formula_updates)):
col_updates.setdefault(col_rec, {}).setdefault('formula', new_formula) col_updates.setdefault(col_rec, {}).setdefault('formula', new_formula)
acl.perform_acl_rule_renames(self, renames)
dropdown_condition.perform_dropdown_condition_renames(self, renames)
update_pairs = col_updates.items() update_pairs = col_updates.items()
# Disallow most changes to summary group-by columns, except to match the underlying column. # Disallow most changes to summary group-by columns, except to match the underlying column.
@ -752,6 +749,10 @@ class UserActions(object):
self.doBulkUpdateFromPairs(table_id, update_pairs) self.doBulkUpdateFromPairs(table_id, update_pairs)
if renames:
acl.perform_acl_rule_renames(self, renames)
dropdown_condition.perform_dropdown_condition_renames(self, renames)
for table_id in rebuild_summary_tables: for table_id in rebuild_summary_tables:
table = self._engine.tables[table_id] table = self._engine.tables[table_id]
self._engine._update_table_model(table, table.user_table) self._engine._update_table_model(table, table.user_table)

Loading…
Cancel
Save