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
Commits
ca78f7cd
Verified
Commit
ca78f7cd
authored
3 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix getters for substitutions table schema to work with events that are not amending other events
parent
650cc709
No related branches found
No related tags found
1 merge request
!394
Show events with current changes in substitutions table
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/chronos/schema/__init__.py
+19
-13
19 additions, 13 deletions
aleksis/apps/chronos/schema/__init__.py
with
19 additions
and
13 deletions
aleksis/apps/chronos/schema/__init__.py
+
19
−
13
View file @
ca78f7cd
...
...
@@ -153,11 +153,13 @@ class SubstitutionType(graphene.ObjectType):
def
resolve_old_groups
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
return
le
.
amends
.
groups
.
all
()
or
le
.
groups
.
all
()
if
le
.
amends
and
le
.
amends
.
groups
.
all
():
return
le
.
amends
.
groups
.
all
()
return
le
.
groups
.
all
()
def
resolve_new_groups
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
if
le
.
groups
.
all
()
and
le
.
amends
.
groups
.
all
():
if
le
.
groups
.
all
()
and
le
.
amends
and
le
.
amends
.
groups
.
all
():
return
le
.
groups
.
all
()
else
:
return
[]
...
...
@@ -176,11 +178,13 @@ class SubstitutionType(graphene.ObjectType):
def
resolve_old_teachers
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
return
le
.
amends
.
teachers
.
all
()
or
le
.
teachers
.
all
()
if
le
.
amends
and
le
.
amends
.
teachers
.
all
():
return
le
.
amends
.
teachers
.
all
()
return
le
.
teachers
.
all
()
def
resolve_new_teachers
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
if
le
.
teachers
.
all
()
and
le
.
amends
.
teachers
.
all
():
if
le
.
teachers
.
all
()
and
le
.
amends
and
le
.
amends
.
teachers
.
all
():
return
le
.
teachers
.
all
()
else
:
return
[]
...
...
@@ -189,30 +193,32 @@ class SubstitutionType(graphene.ObjectType):
le
=
root
[
"
REFERENCE_OBJECT
"
]
if
le
.
name
==
"
supervision
"
:
return
"
SUPERVISION
"
elif
not
le
.
amends
.
subject
and
not
le
.
subject
:
return
le
.
amends
.
title
elif
not
(
le
.
amends
and
le
.
amends
.
subject
)
and
not
le
.
subject
:
if
le
.
amends
:
return
le
.
amends
.
title
return
le
.
title
else
:
subject
=
le
.
amends
.
subject
or
le
.
subject
subject
=
le
.
amends
.
subject
if
le
.
amends
and
le
.
amends
.
subject
else
le
.
subject
return
subject
.
short_name
or
subject
.
name
def
resolve_new_subject
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
if
le
.
name
==
"
supervision
"
:
return
None
elif
not
le
.
amends
.
subject
and
not
le
.
subject
:
return
le
.
title
elif
le
.
subject
and
le
.
amends
.
subject
:
elif
le
.
subject
and
le
.
amends
and
le
.
amends
.
subject
:
return
le
.
subject
.
short_name
or
le
.
subject
.
name
else
:
return
None
def
resolve_old_rooms
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
return
le
.
amends
.
rooms
.
all
()
or
le
.
rooms
.
all
()
if
le
.
amends
and
le
.
amends
.
rooms
.
all
():
return
le
.
amends
.
rooms
.
all
()
return
le
.
rooms
.
all
()
def
resolve_new_rooms
(
root
,
info
):
le
=
root
[
"
REFERENCE_OBJECT
"
]
if
le
.
rooms
.
all
()
and
le
.
amends
.
rooms
.
all
():
if
le
.
rooms
.
all
()
and
le
.
amends
and
le
.
amends
.
rooms
.
all
():
return
le
.
rooms
.
all
()
else
:
return
[]
...
...
@@ -221,7 +227,7 @@ class SubstitutionType(graphene.ObjectType):
return
root
[
"
REFERENCE_OBJECT
"
].
cancelled
def
resolve_notes
(
root
,
info
):
return
root
[
"
REFERENCE_OBJECT
"
].
title
or
root
[
"
REFERENCE_OBJECT
"
].
comment
return
root
[
"
REFERENCE_OBJECT
"
].
comment
class
SubstitutionsForDateType
(
graphene
.
ObjectType
):
...
...
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