fix: Remove cmd only if exist (#12886)
* only remove cmd if exist When calling this function from backend this line raises key error as there's no such key called cmd * style: Simplify code Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
parent
50f9a7e1d8
commit
d8dca020b3
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ def add_node():
|
|||
doc.save()
|
||||
|
||||
def make_tree_args(**kwarg):
|
||||
del kwarg['cmd']
|
||||
kwarg.pop('cmd', None)
|
||||
|
||||
doctype = kwarg['doctype']
|
||||
parent_field = 'parent_' + doctype.lower().replace(' ', '_')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue