(core) Simplify InitNewDoc since the timezone and locale is never actually used

Summary: InitNewDoc is essentially only used to generate initialDocSql, so it doesn't make sense to set the timezone and locale. They are always set when actually creating a new doc anyway. Discussed in https://grist.slack.com/archives/C0234CPPXPA/p1650312714217089.

Test Plan: this

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3394
This commit is contained in:
Alex Hall
2022-04-22 23:53:39 +02:00
parent af5b3c9004
commit 040fa85a8b
3 changed files with 5 additions and 9 deletions

View File

@@ -275,14 +275,12 @@ class UserActions(object):
#----------------------------------------
@useraction
def InitNewDoc(self, timezone, locale):
def InitNewDoc(self):
creation_actions = schema.schema_create_actions()
self._engine.out_actions.stored.extend(creation_actions)
self._engine.out_actions.direct += [True] * len(creation_actions)
self._do_doc_action(actions.AddRecord("_grist_DocInfo", 1,
{'schemaVersion': schema.SCHEMA_VERSION,
'timezone': timezone,
'documentSettings': json.dumps({'locale': locale})}))
{'schemaVersion': schema.SCHEMA_VERSION}))
# Set up initial ACL data.
# NOTE The special records below are not actually used. They were intended for obsolete ACL