mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add 'user' variable to trigger formulas
Summary: The 'user' variable has a similar API to the one from access rules: it contains properties about a user, such as their full name and email address, as well as optional, user-defined attributes that are populated via user attribute tables. Test Plan: Python unit tests. Reviewers: alexmojaki, paulfitz, dsagal Reviewed By: alexmojaki, dsagal Subscribers: paulfitz, dsagal, alexmojaki Differential Revision: https://phab.getgrist.com/D2898
This commit is contained in:
@@ -334,14 +334,14 @@ class EngineTestCase(unittest.TestCase):
|
||||
def add_records(self, table_name, col_names, row_data):
|
||||
return self.apply_user_action(self.add_records_action(table_name, [col_names] + row_data))
|
||||
|
||||
def apply_user_action(self, user_action_repr, is_undo=False):
|
||||
def apply_user_action(self, user_action_repr, is_undo=False, user=None):
|
||||
if not is_undo:
|
||||
log.debug("Applying user action %r" % (user_action_repr,))
|
||||
if self._undo_state_tracker is not None:
|
||||
doc_state = self.getFullEngineData()
|
||||
|
||||
self.call_counts.clear()
|
||||
out_actions = self.engine.apply_user_actions([useractions.from_repr(user_action_repr)])
|
||||
out_actions = self.engine.apply_user_actions([useractions.from_repr(user_action_repr)], user)
|
||||
out_actions.calls = self.call_counts.copy()
|
||||
|
||||
if not is_undo and self._undo_state_tracker is not None:
|
||||
|
||||
Reference in New Issue
Block a user