diff --git a/aleksis/apps/chronos/schema/__init__.py b/aleksis/apps/chronos/schema/__init__.py index f62355e35af5da2b9e23faf4c3ff192678826fdb..a33711c85afdc5013030f83f1a4ecb20adb704fe 100644 --- a/aleksis/apps/chronos/schema/__init__.py +++ b/aleksis/apps/chronos/schema/__init__.py @@ -35,15 +35,6 @@ class TimetableRoomType(DjangoObjectType): skip_registry = True -# There is another unrelated CalendarEventType in aleksis/core/schema/calendar -# This CalendarEventType is needed for the inherited amends field of LessonEvent -# to work in the graphql query. -class CalendarEventForLessonEventType(DjangoObjectType): - class Meta: - model = CalendarEvent - fields = ("id", "amends", "datetime_start", "datetime_end") - - class LessonEventType(DjangoObjectType): class Meta: model = LessonEvent @@ -63,6 +54,8 @@ class LessonEventType(DjangoObjectType): "id": ["exact", "lte", "gte"], } + amends = graphene.Field(lambda: LessonEventType, required=False) + class DatetimeTimezoneMixin: """Handle datetimes for mutations with CalendarEvent objects.