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
e540bc0e
Commit
e540bc0e
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Change default values in schema to None
parent
e1bac805
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/schema.py
+15
-14
15 additions, 14 deletions
aleksis/apps/alsijil/schema.py
with
15 additions
and
14 deletions
aleksis/apps/alsijil/schema.py
+
15
−
14
View file @
e540bc0e
...
...
@@ -82,16 +82,13 @@ class PersonalNoteMutation(graphene.Mutation):
person_id
,
lesson_documentation
,
personal_note_id
=
None
,
late
=
0
,
absent
=
Fals
e
,
excused
=
Fals
e
,
late
=
None
,
absent
=
Non
e
,
excused
=
Non
e
,
excuse_type
=
None
,
remarks
=
""
,
remarks
=
None
,
extra_marks
=
None
):
if
extra_marks
is
None
:
extra_marks
=
[]
person
=
Person
.
objects
.
get
(
pk
=
person_id
)
lesson_documentation
=
LessonDocumentation
.
objects
.
get
(
pk
=
lesson_documentation
)
...
...
@@ -103,22 +100,26 @@ class PersonalNoteMutation(graphene.Mutation):
week
=
lesson_documentation
.
week
,
year
=
lesson_documentation
.
year
,
)
if
late
:
if
late
is
not
None
:
personal_note
.
late
=
late
if
absent
is
not
None
:
personal_note
.
absent
=
absent
if
excused
is
not
None
:
personal_note
.
excused
=
excused
if
excuse_type
:
if
excuse_type
is
not
None
:
personal_note
.
excuse_type
=
ExcuseType
.
objects
.
get
(
pk
=
excuse_type
)
if
remarks
:
if
remarks
is
not
None
:
personal_note
.
remarks
=
remarks
personal_note
.
save
()
extra_marks
=
ExtraMark
.
objects
.
filter
(
pk__in
=
extra_marks
)
personal_note
.
extra_marks
.
set
(
extra_marks
)
personal_note
.
groups_of_person
.
set
(
person
.
member_of
.
all
())
if
created
:
personal_note
.
groups_of_person
.
set
(
person
.
member_of
.
all
()
)
personal_note
.
save
()
if
extra_marks
is
not
None
:
extra_marks
=
ExtraMark
.
objects
.
filter
(
pk__in
=
extra_marks
)
personal_note
.
extra_marks
.
set
(
extra_marks
)
personal_note
.
save
()
return
PersonalNoteMutation
(
personal_note
=
personal_note
)
...
...
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