Skip to content
Snippets Groups Projects
Verified Commit 1e979f87 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Reformat

parent a71d04c2
No related branches found
No related tags found
1 merge request!301New data model based on calendar events
# flake8: noqa: DJ01
from __future__ import annotations
import os
import itertools
import os
from datetime import date, datetime, time, timedelta
from itertools import chain
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
......@@ -1414,7 +1414,7 @@ class LessonEvent(CalendarEvent):
@property
def teacher_names(self: "LessonEvent") -> str:
return ", ".join([t.full_name for t in self.teachers.all()])
return ", ".join([t.full_name for t in self.teachers.all()])
@property
def room_names(self: "LessonEvent") -> str:
......@@ -1426,11 +1426,7 @@ class LessonEvent(CalendarEvent):
if reference_object.title:
return reference_object.title
elif reference_object.subject:
return (
reference_object.subject.name
+ " · "
+ reference_object.group_names
)
return reference_object.subject.name + " · " + reference_object.group_names
return _("Lesson")
......@@ -1457,7 +1453,9 @@ class LessonEvent(CalendarEvent):
def value_attendee(cls, reference_object: "LessonEvent") -> str:
"""Get the attendees of the event."""
# FIXME: Permissions
attendees = [t.get_vcal_address(role="CHAIR") for t in reference_object.teachers.all()] + [g.get_vcal_address(role="REQ-PARTICIPANT") for g in reference_object.all_members]
attendees = [t.get_vcal_address(role="CHAIR") for t in reference_object.teachers.all()] + [
g.get_vcal_address(role="REQ-PARTICIPANT") for g in reference_object.all_members
]
return [a for a in attendees if a]
@classmethod
......@@ -1484,7 +1482,6 @@ class SupervisionEvent(LessonEvent):
name = "supervision"
verbose_name = _("Supervisions")
@classmethod
def value_title(cls, reference_object: "LessonEvent") -> str:
"""Get the title of the event."""
......@@ -1493,4 +1490,6 @@ class SupervisionEvent(LessonEvent):
@classmethod
def value_description(cls, reference_object: "LessonEvent") -> str:
return render_to_string("chronos/supervision_event_description.txt", {"event": reference_object})
\ No newline at end of file
return render_to_string(
"chronos/supervision_event_description.txt", {"event": reference_object}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment