Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Merge requests
!361
Resolve "Fix timezone handling with substitutions/amend dialog"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Fix timezone handling with substitutions/amend dialog"
250-fix-timezone-handling-with-substitutions-amend-dialog
into
master
Overview
0
Commits
3
Pipelines
5
Changes
1
Merged
Julian
requested to merge
250-fix-timezone-handling-with-substitutions-amend-dialog
into
master
7 months ago
Overview
0
Commits
3
Pipelines
5
Changes
1
Expand
Closes
#250 (closed)
0
0
Merge request reports
Viewing commit
a2115e41
Prev
Next
Show latest version
1 file
+
0
−
22
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
a2115e41
Drop unused import
· a2115e41
Julian
authored
7 months ago
aleksis/apps/chronos/schema/__init__.py
+
0
−
22
Options
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
Loading