Unnecessary to pass both root and model factory
This commit is contained in:
parent
6d0aa3eb34
commit
9252e524ae
|
@ -43,7 +43,7 @@ def command_create(args):
|
|||
return -1
|
||||
|
||||
# Perform command
|
||||
create_lexicon(root, args.model_factory, args.name, args.user)
|
||||
create_lexicon(root, args.name, args.user)
|
||||
|
||||
# Output already logged by create_lexicon
|
||||
return 0
|
||||
|
|
|
@ -28,7 +28,6 @@ def valid_name(name: str) -> bool:
|
|||
|
||||
def create_lexicon(
|
||||
root: RootConfigDirectoryContext,
|
||||
model_factory: ModelFactory,
|
||||
name: str,
|
||||
editor: UserModel) -> LexiconModel:
|
||||
"""
|
||||
|
@ -74,6 +73,7 @@ def create_lexicon(
|
|||
pass # Create an empry config file
|
||||
|
||||
# Load the lexicon and add the editor and default character
|
||||
model_factory: ModelFactory = ModelFactory(root)
|
||||
lexicon = model_factory.lexicon(lid)
|
||||
with lexicon.ctx.edit_config() as cfg:
|
||||
cfg.join.joined.append(editor.uid)
|
||||
|
|
Loading…
Reference in New Issue