Fix multiple Teacher

This commit is contained in:
2024-04-17 14:53:02 +02:00
parent 0a4cca102b
commit d6f7fa0661
2 changed files with 7 additions and 2 deletions

View File

@ -63,7 +63,10 @@ async def getWeek(weekstart: datetime, file: str, showsat: bool):
formstart = forml[0]
formend = forml[1]
try:
teacher = event["ATTENDEE"].params["CN"]
if type(event["ATTENDEE"]) is not list:
teacher = [event["ATTENDEE"].params["CN"]]
else:
teacher = [i.params["CN"] for i in event["ATTENDEE"]]
except KeyError:
teacher = ""
eventdict = {

View File

@ -66,7 +66,9 @@
{% block event %} {% endblock %}
<p class="title">{{ i["name"] }}</p>
<p class="room">{{ i["room"] }}</p>
<p class="teacher">{{ i["teacher"] }}</p>
{% for teacher in i["teacher"] %}
<p class="teacher">{{ teacher }}</p>
{% endfor %}
<p class="time">{{ i["start"] }} - {{ i["end"] }} ({{ i["dur"] }}h)</p>
</div>
{% endif %}