#1834 - Bugfix when removing item in double nested maps
This commit is contained in:
parent
d86dcb2ee9
commit
71e86ab417
@ -197,15 +197,18 @@ class Item(BaseModel):
|
|||||||
# Hack but it'll do, traverses into a dict
|
# Hack but it'll do, traverses into a dict
|
||||||
last_val_type = list(last_val.keys())
|
last_val_type = list(last_val.keys())
|
||||||
if last_val_type and last_val_type[0] == 'M':
|
if last_val_type and last_val_type[0] == 'M':
|
||||||
last_val = last_val['M']
|
last_val = last_val['M']
|
||||||
|
|
||||||
if key_part not in last_val:
|
if key_part not in last_val:
|
||||||
last_val[key_part] = {'M': {}}
|
last_val[key_part] = {'M': {}}
|
||||||
|
|
||||||
last_val = last_val[key_part]
|
last_val = last_val[key_part]
|
||||||
|
|
||||||
last_val.pop(key_parts[-1], None)
|
last_val_type = list(last_val.keys())
|
||||||
self.attrs.pop(value, None)
|
if last_val_type and last_val_type[0] == 'M':
|
||||||
|
last_val['M'].pop(key_parts[-1], None)
|
||||||
|
else:
|
||||||
|
last_val.pop(key_parts[-1], None)
|
||||||
elif action == 'SET':
|
elif action == 'SET':
|
||||||
key, value = value.split("=", 1)
|
key, value = value.split("=", 1)
|
||||||
key = key.strip()
|
key = key.strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user