Change method of checking if a key is in the dictionary.

The original method would return false if the key contained the boolean "false" causing the value not to be deleted even if it existed.
This commit is contained in:
txjacob 2020-06-17 12:58:14 -05:00 committed by Russell Ballestrini
parent ff609192f5
commit dd7bf5f043

View file

@ -24,7 +24,7 @@ def _nested_delete(document, key):
for list_items in document:
_nested_delete(document=list_items, key=key)
elif isinstance(document, dict):
if document.get(key):
if key in document:
del document[key]
for dict_key, dict_value in iteritems(document):
_nested_delete(document=dict_value, key=key)