Skip to content

Commit 3fca33e

Browse files
committed
Fix human title generation in calendar
Closes gh-1292
1 parent 3e054de commit 3fca33e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

course/calendar.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from course.page.base import HumanTextFeedbackForm
4+
35

46
__copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
57

@@ -423,7 +425,9 @@ def view_calendar(pctx):
423425
if event.ordinal is not None:
424426
human_title = kind_desc["title"].format(nr=event.ordinal)
425427
else:
426-
human_title = kind_desc["title"].rstrip("{nr}").strip()
428+
human_title = kind_desc["title"]
429+
if human_title.endswith("{nr}"):
430+
human_title = human_title[:-4].strip()
427431

428432
description = None
429433
show_description = True

0 commit comments

Comments
 (0)