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

Merge branch 'new-model-based-on-calendar' of...

Merge branch 'new-model-based-on-calendar' of edugit.org:aleksis/official/aleksis-app-chronos into new-model-based-on-calendar
parents 459937ca 9e492da7
No related branches found
No related tags found
1 merge request!301New data model based on calendar events
Pipeline #143524 failed
......@@ -1612,3 +1612,20 @@ class SupervisionEvent(LessonEvent):
return render_to_string(
"chronos/supervision_event_description.txt", {"event": reference_object}
)
@classmethod
def get_objects(cls, request, params=None) -> Iterable:
"""Return all objects that should be included in the calendar."""
objs = super().get_objects(request, params)
if params:
obj_id = int(params.get("id", 0))
type = params.get("type", None)
if type and obj_id:
if type == "TEACHER":
return objs.for_teacher(obj_id)
elif type == "GROUP":
return objs.for_group(obj_id)
elif type == "ROOM":
return objs.for_room(obj_id)
return objs.for_person(request.user.person)
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