Skip to content
Snippets Groups Projects
Commit 7476e8b2 authored by Megan Henning's avatar Megan Henning
Browse files

Simplify if statement

parent b39c656c
No related branches found
No related tags found
No related merge requests found
......@@ -345,8 +345,7 @@ def _update_container_nulls(base_query, update, container_type):
bulk = config.db[coll_name].initialize_unordered_bulk_op()
if (update.get('metadata') is not None and
(cont.get('metadata') is None or cont.get('metadata',{}).keys == 0)):
if update.get('metadata') and not cont.get('metadata'):
# If we are trying to update metadata fields and the container metadata does not exist or is empty,
# metadata can all be updated at once for efficiency
m_update = util.mongo_sanitize_fields(update.pop('metadata'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment