mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Automatically remove empty summary table rows
Summary: When the `getSummarySourceGroup` function (used by the `$group` column) finds that the group is empty, raise a new special exception `EmptySummaryRow`. The engine catches this exception, avoids saving a value to the cell, and removes the record. Test Plan: Updated several Python tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3489
This commit is contained in:
@@ -997,7 +997,8 @@ class UserActions(object):
|
||||
def BulkRemoveRecord(self, table_id, row_ids):
|
||||
# table_rec will not be found for metadata tables, but they are not summary tables anyway.
|
||||
table_rec = self._docmodel.tables.lookupOne(tableId=table_id)
|
||||
if table_rec and table_rec.summarySourceTable:
|
||||
# docmodel.setAutoRemove is used for empty summary table rows, but does so 'indirectly'
|
||||
if table_rec and table_rec.summarySourceTable and self._indirection_level == DIRECT_ACTION:
|
||||
raise ValueError("Cannot remove record from summary table")
|
||||
|
||||
method = self._overrides.get(('BulkRemoveRecord', table_id), self.doBulkRemoveRecord)
|
||||
|
||||
Reference in New Issue
Block a user