Skip to content
Snippets Groups Projects
Commit e9f8e9ed authored by Julian's avatar Julian Committed by permcu
Browse files

Update newly created documentations as well

parent 726e20f2
No related branches found
No related tags found
1 merge request!356Add dialog for creation of long-term absences
......@@ -98,30 +98,30 @@ class DocumentationBatchCreateOrUpdateMutation(graphene.Mutation):
# Sadly, we can't use the update_or_create method since create_defaults
# is only introduced in Django 5.0
if _id.startswith("DUMMY"):
return Documentation.create_from_lesson_event(
obj = Documentation.create_from_lesson_event(
info.context.user,
*Documentation.parse_dummy(_id),
)
else:
obj = Documentation.objects.get(id=_id)
if not info.context.user.has_perm("alsijil.edit_documentation_rule", obj):
raise PermissionDenied()
if not info.context.user.has_perm("alsijil.edit_documentation_rule", obj):
raise PermissionDenied()
if doc.topic is not None:
obj.topic = doc.topic
if doc.homework is not None:
obj.homework = doc.homework
if doc.group_note is not None:
obj.group_note = doc.group_note
if doc.topic is not None:
obj.topic = doc.topic
if doc.homework is not None:
obj.homework = doc.homework
if doc.group_note is not None:
obj.group_note = doc.group_note
if doc.subject is not None:
obj.subject = Subject.objects.get(pk=doc.subject)
if doc.teachers is not None:
obj.teachers.set(Person.objects.filter(pk__in=doc.teachers))
if doc.subject is not None:
obj.subject = Subject.objects.get(pk=doc.subject)
if doc.teachers is not None:
obj.teachers.set(Person.objects.filter(pk__in=doc.teachers))
obj.save()
return obj
obj.save()
return obj
@classmethod
def mutate(cls, root, info, input): # noqa
......
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