Ensure time log reports have an extension
Some checks failed
CI / test (push) Failing after 5m0s
Lint / test (push) Successful in 31s
Trivy / test (push) Successful in 22s

This commit is contained in:
Miguel Jacq 2025-12-01 10:27:44 +11:00
parent 4d3593e960
commit 535a380616
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 5 additions and 0 deletions

View file

@ -3,6 +3,7 @@
* Add + button to time log widget in side bar to have a simplified log entry dialog (without summary or report option)
* Allow click-and-drag mouse select on lines with checkbox, to capture the checkbox as well as the text.
* Allow changing the date when logging time (rather than having to go to that date before clicking on adding time log/opening time log manager)
* Ensure time log reports have an extension
# 0.5.4

View file

@ -1076,6 +1076,8 @@ class TimeReportDialog(QDialog):
)
if not filename:
return
if not filename.endswith(".csv"):
filename = f"{filename}.csv"
try:
with open(filename, "w", newline="", encoding="utf-8") as f:
@ -1124,6 +1126,8 @@ class TimeReportDialog(QDialog):
)
if not filename:
return
if not filename.endswith(".pdf"):
filename = f"{filename}.pdf"
# ---------- Build chart image (hours per period) ----------
per_period_minutes: dict[str, int] = defaultdict(int)