Skip to content
Snippets Groups Projects
Verified Commit ec50cb19 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Reformat and lint

parent a25ea04a
No related branches found
No related tags found
2 merge requests!352Draft: Resolve "Add dialog with each lesson's students",!350Resolve "Add simple course book list"
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
this.updateStatus(); this.updateStatus();
}, },
deep: true, deep: true,
} },
}, },
mounted() { mounted() {
this.updateStatus(); this.updateStatus();
...@@ -110,13 +110,17 @@ export default { ...@@ -110,13 +110,17 @@ export default {
if (DateTime.now() < this.documentationDateTimeStart) { if (DateTime.now() < this.documentationDateTimeStart) {
this.statusTimeout = setTimeout( this.statusTimeout = setTimeout(
this.updateStatus, this.updateStatus,
this.documentationDateTimeStart.diff(DateTime.now(), "seconds").toObject(), this.documentationDateTimeStart
); .diff(DateTime.now(), "seconds")
.toObject(),
);
} else if (DateTime.now() < this.documentationDateTimeEnd) { } else if (DateTime.now() < this.documentationDateTimeEnd) {
this.statusTimeout = setTimeout( this.statusTimeout = setTimeout(
this.updateStatus, this.updateStatus,
this.documentationDateTimeEnd.diff(DateTime.now(), "seconds").toObject(), this.documentationDateTimeEnd
); .diff(DateTime.now(), "seconds")
.toObject(),
);
} }
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -164,7 +164,10 @@ export default { ...@@ -164,7 +164,10 @@ export default {
cached[index] = { cached[index] = {
...this.documentation, ...this.documentation,
...object, ...object,
oldId: this.documentation.id !== object.id ? this.documentation.id : this.documentation.oldId, oldId:
this.documentation.id !== object.id
? this.documentation.id
: this.documentation.oldId,
}; };
} }
return cached; return cached;
......
from datetime import date, datetime, timezone from datetime import date, datetime
from typing import Optional, Union from typing import Optional, Union
from urllib.parse import urlparse from urllib.parse import urlparse
......
from datetime import datetime, timezone from datetime import datetime
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
...@@ -181,7 +181,9 @@ class DocumentationBatchCreateOrUpdateMutation(graphene.Mutation): ...@@ -181,7 +181,9 @@ class DocumentationBatchCreateOrUpdateMutation(graphene.Mutation):
# Timezone removal is necessary due to ISO style offsets are no valid timezones. # 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. # Instead, we take the timezone from the lesson_event and save it in a dedicated field.
obj = Documentation.objects.create( obj = Documentation.objects.create(
datetime_start=datetime.fromisoformat(datetime_start).astimezone(lesson_event.timezone), datetime_start=datetime.fromisoformat(datetime_start).astimezone(
lesson_event.timezone
),
datetime_end=datetime.fromisoformat(datetime_end).astimezone(lesson_event.timezone), datetime_end=datetime.fromisoformat(datetime_end).astimezone(lesson_event.timezone),
lesson_event=lesson_event, lesson_event=lesson_event,
course=lesson_event.course, course=lesson_event.course,
......
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