Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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-Alsijil
Commits
ac8b93d7
Verified
Commit
ac8b93d7
authored
11 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Use reversion for coursebook entries
parent
c035f05e
No related branches found
No related tags found
2 merge requests
!352
Draft: Resolve "Add dialog with each lesson's students"
,
!350
Resolve "Add simple course book list"
Pipeline
#178680
failed
11 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/schema/documentation.py
+5
-3
5 additions, 3 deletions
aleksis/apps/alsijil/schema/documentation.py
with
5 additions
and
3 deletions
aleksis/apps/alsijil/schema/documentation.py
+
5
−
3
View file @
ac8b93d7
...
...
@@ -6,6 +6,7 @@ from django.utils.timezone import localdate, localtime
import
graphene
from
graphene_django.types
import
DjangoObjectType
from
guardian.shortcuts
import
get_objects_for_user
from
reversion
import
create_revision
,
set_comment
,
set_user
from
aleksis.apps.alsijil.util.predicates
import
can_edit_documentation
,
is_in_allowed_time_range
from
aleksis.apps.chronos.models
import
LessonEvent
...
...
@@ -117,8 +118,6 @@ class DocumentationBatchCreateOrUpdateMutation(graphene.Mutation):
and
datetime_start
<=
localtime
()
)
):
# Timezone removal is necessary due to ISO style offsets are no valid timezones.
# Instead, we take the timezone from the lesson_event and save it in a dedicated field.
obj
=
Documentation
.
objects
.
create
(
datetime_start
=
datetime_start
,
datetime_end
=
datetime_end
,
...
...
@@ -159,6 +158,9 @@ class DocumentationBatchCreateOrUpdateMutation(graphene.Mutation):
@classmethod
def
mutate
(
cls
,
root
,
info
,
input
):
# noqa
objs
=
[
cls
.
create_or_update
(
info
,
doc
)
for
doc
in
input
]
with
create_revision
():
set_user
(
info
.
context
.
user
)
set_comment
(
"
Updated in coursebook
"
)
objs
=
[
cls
.
create_or_update
(
info
,
doc
)
for
doc
in
input
]
return
DocumentationBatchCreateOrUpdateMutation
(
documentations
=
objs
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment