Make conferences a top-level list

This commit is contained in:
Edward Betts 2024-01-04 15:08:12 +00:00
parent b1139b79d2
commit 5786e3d575
2 changed files with 2 additions and 5 deletions

View file

@ -52,8 +52,5 @@ def get_list(filepath: str) -> list[Event]:
url=conf.url, url=conf.url,
going=conf.going, going=conf.going,
) )
for conf in ( for conf in (Conference(**conf) for conf in yaml.safe_load(open(filepath, "r")))
Conference(**conf)
for conf in yaml.safe_load(open(filepath, "r"))["conferences"]
)
] ]

View file

@ -110,7 +110,7 @@ def conference_list() -> str:
"""Page showing a list of conferences.""" """Page showing a list of conferences."""
data_dir = app.config["PERSONAL_DATA"] data_dir = app.config["PERSONAL_DATA"]
filepath = os.path.join(data_dir, "conferences.yaml") filepath = os.path.join(data_dir, "conferences.yaml")
item_list = yaml.safe_load(open(filepath))["conferences"] item_list = yaml.safe_load(open(filepath))
today = date.today() today = date.today()
for conf in item_list: for conf in item_list:
conf["start_date"] = as_date(conf["start"]) conf["start_date"] = as_date(conf["start"])