Handles missing birth/death years
Ensures that the "Lived" metadata field is only written if both birth and death years are available to prevent generating incomplete entries. Also, simplifies exception handling during note generation by removing the unused exception variable.
This commit is contained in:
1 file changed
+2
-1
@@ -113,6 +113,7 @@ class MarkdownGenerator:
|
||||
self._write_metadata(f, "Name", individual.get_full_name())
|
||||
|
||||
# Lived years
|
||||
if birth['year'] or death['year']:
|
||||
lived = f"{birth['year']}-{death['year']}"
|
||||
self._write_metadata(f, "Lived", lived)
|
||||
|
||||
@@ -483,7 +484,7 @@ class MarkdownGenerator:
|
||||
try:
|
||||
path = self.generate_note(individual)
|
||||
paths.append(path)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logger.exception(
|
||||
f"Failed to generate note for {individual.get_full_name()}"
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user