Skip to content
Snippets Groups Projects
Commit 4ac7883d authored by permcu's avatar permcu
Browse files

Use get_documentations_for_events in lessons_for_persons query

& use documentations instead of lesson-events
parent 83eb191f
No related branches found
No related tags found
1 merge request!362Resolve "Add personal note management dialog in course book"
Pipeline #183358 failed
......@@ -21,12 +21,20 @@ query lessonsForPersons(
id
datetimeStart
datetimeEnd
course
subject
course {
id
name
}
subject {
id
name
shortName
colourFg
colourBg
}
}
}
}
# TODO: course is missing in LessonEventType
# Use absencesInputType
mutation createAbsences(
......
......@@ -18,7 +18,10 @@ from .documentation import (
DocumentationBatchCreateOrUpdateMutation,
DocumentationType,
)
from .absences import (
LessonsForPersonType,
AbsencesBatchCreateMutation,
)
class Query(graphene.ObjectType):
documentations = FilterOrderList(DocumentationType)
......@@ -159,15 +162,19 @@ class Query(graphene.ObjectType):
"obj_id": PERSON_ID,
}
events = LessonEvent.get_single_events(
datetime.combine(start, datetime.min.time()),
datetime.combine(end, datetime.max.time()),
None,
event_params,
with_reference_object=True,
)
docs, dummies = Documentation.get_documentations_for_events(events)
lessons_for_person.append(
id=person,
lessons=LessonEvent.get_single_events(
datetime.combine(start, datetime.min.time()),
datetime.combine(date_end, datetime.max.time()),
None,
event_params,
with_reference_object=True,
)
lessons=docs + dummies
)
return lessons_for_person
......
import graphene
from aleksis.apps.chronos.schema import LessonEventType
from .documentation import DocumentationType
class LessonsForPersonType(graphene.ObjectType):
id = graphene.ID() # noqa
lessons = graphene.List(LessonEventType)
lessons = graphene.List(DocumentationType)
class AbsencesBatchCreateMutation(graphene.Mutation):
class Arguments:
......
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