diff --git a/bin/streamlit.py b/bin/streamlit.py index 7c7934e2..82c62139 100644 --- a/bin/streamlit.py +++ b/bin/streamlit.py @@ -12,7 +12,11 @@ def load_yaml_template(filename): return default_template() try: with open(f'yaml/{filename}', 'r') as file: - return yaml.safe_load(file) + data = yaml.safe_load(file) + # Convert PEMetadata to dict if it's a list + if 'Details' in data and 'PEMetadata' in data['Details'] and isinstance(data['Details']['PEMetadata'], list): + data['Details']['PEMetadata'] = data['Details']['PEMetadata'][0] if data['Details']['PEMetadata'] else {} + return data except yaml.YAMLError as e: st.error(f"Error loading YAML file: {e}") return default_template() @@ -210,4 +214,4 @@ def handle_date(date_value, field_name): return datetime.now().date() if __name__ == "__main__": - main() \ No newline at end of file + main()