diff --git a/core/models/logbooks.py b/core/models/logbooks.py index eb8d649..7aefa3f 100644 --- a/core/models/logbooks.py +++ b/core/models/logbooks.py @@ -113,30 +113,29 @@ def writelogbook(year, filename): except: print(" ! Very Bad Error RENDERING template " + template) raise - print(" - template rendered") + # print(" - template rendered") try: - print(" - end") - print(f" - endmatter {year} {filename} {settings.EXPOWEB}") try: - endpath = Path(settings.EXPOWEB, "years", year, "endmatter.html") + endpath = Path(settings.EXPOWEB, "years", str(year), "endmatter.html") except: print(" ! FAIL Path " + {(settings.EXPOWEB, "years", year, "endmatter.html")}) - print(f" - endpath {endpath}") + raise + # print(f" - endpath {endpath}") endmatter = "" if endpath.is_file(): - print(" - endpath") - + # print(" - endpath") try: with open(endpath, "r") as end: endmatter = end.read() except: print(" ! Very Bad Error opening " + endpath) + raise except: print(" ! FAIL endpath " + endpath) raise - print(" - endpath opened") + # print(" - endpath opened") - frontpath = Path(settings.EXPOWEB, "years", year, "frontmatter.html") + frontpath = Path(settings.EXPOWEB, "years", str(year), "frontmatter.html") if frontpath.is_file(): try: with open(frontpath, "r") as front: @@ -146,9 +145,9 @@ def writelogbook(year, filename): logbookfile = re.sub(r"
", "\n" + frontmatter + endmatter, logbookfile) else: logbookfile = re.sub(r"", f"\n