#387 Fix for int collection name

pull/392/head
meisnate12 3 years ago
parent b4e28825b0
commit d2dedccc44

@ -18,19 +18,18 @@ class Metadata:
logger.info("") logger.info("")
logger.info(f"Loading Metadata {file_type}: {path}") logger.info(f"Loading Metadata {file_type}: {path}")
def get_dict(attribute, attr_data, check_list=None): def get_dict(attribute, attr_data, check_list=None):
if check_list is None:
check_list = []
if attr_data and attribute in attr_data: if attr_data and attribute in attr_data:
if attr_data[attribute]: if attr_data[attribute]:
if isinstance(attr_data[attribute], dict): if isinstance(attr_data[attribute], dict):
if check_list: new_dict = {}
new_dict = {} for a_name, a_data in attr_data[attribute].items():
for a_name, a_data in attr_data[attribute].items(): if a_name in check_list:
if a_name in check_list: logger.error(f"Config Warning: Skipping duplicate {attribute[:-1] if attribute[-1] == 's' else attribute}: {a_name}")
logger.error(f"Config Warning: Skipping duplicate {attribute[:-1] if attribute[-1] == 's' else attribute}: {a_name}") else:
else: new_dict[str(a_name)] = a_data
new_dict[a_name] = a_data return new_dict
return new_dict
else:
return attr_data[attribute]
else: else:
logger.warning(f"Config Warning: {attribute} must be a dictionary") logger.warning(f"Config Warning: {attribute} must be a dictionary")
else: else:

Loading…
Cancel
Save