Skip to content
Snippets Groups Projects
Verified Commit a2115e41 authored by Julian's avatar Julian Committed by Jonathan Weth
Browse files

Drop unused import

parent fdbc1b63
No related branches found
No related tags found
1 merge request!361Resolve "Fix timezone handling with substitutions/amend dialog"
Pipeline #192279 failed
from datetime import timezone
import graphene
from graphene_django import DjangoObjectType
......@@ -60,26 +58,6 @@ class LessonEventType(DjangoObjectType):
amends = graphene.Field(lambda: LessonEventType, required=False)
class DatetimeTimezoneMixin:
"""Handle datetimes for mutations with CalendarEvent objects.
This is necessary because the client sends timezone information as
ISO string which only includes an offset (+00:00 UTC) and an
offset is not a valid timezone. Instead we set UTC as timezone
here directly.
"""
@classmethod
def handle_datetime_start(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
@classmethod
def handle_datetime_end(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
class AmendLessonBatchCreateMutation(BaseBatchCreateMutation):
class Meta:
model = LessonEvent
......
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