From 03696fee7d38c1e195c688c4280e4297b22a1ae3 Mon Sep 17 00:00:00 2001
From: Hangzhi Yu <hangzhi@protonmail.com>
Date: Wed, 10 Apr 2024 14:59:05 +0200
Subject: [PATCH] Reformat

---
 .../documentation/LessonInformation.vue       | 19 ++++++++++--
 .../documentation/LessonSummary.vue           | 31 ++++++++++++-------
 aleksis/apps/alsijil/rules.py                 |  2 +-
 aleksis/apps/alsijil/util/predicates.py       |  2 +-
 4 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
index e9559ac97..a07172dc5 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
@@ -26,7 +26,13 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue";
     >
       {{ documentation.course?.name }}
     </span>
-    <div :class="{ 'd-flex align-center flex-wrap gap': true, 'justify-center': largeGrid, 'justify-start': !largeGrid }">
+    <div
+      :class="{
+        'd-flex align-center flex-wrap gap': true,
+        'justify-center': largeGrid,
+        'justify-start': !largeGrid,
+      }"
+    >
       <subject-chip
         v-if="documentation.subject"
         :subject="documentation.subject"
@@ -36,7 +42,8 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue";
       <subject-chip
         v-if="
           documentation?.lessonEvent?.amends?.subject &&
-          documentation.lessonEvent.amends.subject.id !== documentation.subject.id
+          documentation.lessonEvent.amends.subject.id !==
+            documentation.subject.id
         "
         :subject="documentation.lessonEvent.amends.subject"
         v-bind="compact ? dialogActivator.attrs : {}"
@@ -45,7 +52,12 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue";
         disabled
       />
     </div>
-    <div :class="{ 'd-flex align-center flex-wrap gap': true, 'justify-end': !largeGrid }">
+    <div
+      :class="{
+        'd-flex align-center flex-wrap gap': true,
+        'justify-end': !largeGrid,
+      }"
+    >
       <person-chip
         v-for="teacher in documentation.teachers"
         :key="documentation.id + '-teacher-' + teacher.id"
@@ -56,6 +68,7 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue";
       />
       <person-chip
         v-for="teacher in amendedTeachers"
+        :key="documentation.id + '-amendedTeacher-' + teacher.id"
         :person="teacher"
         no-link
         v-bind="compact ? dialogActivator.attrs : {}"
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue
index 7e3cc8841..cee9d5136 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue
@@ -54,16 +54,20 @@
         :loading="loading"
       >
         <template #append>
-            <v-tooltip bottom>
-              <template v-slot:activator="{ on, attrs }">
-                <v-scroll-x-transition>
-                  <v-icon v-if="appendIcon" :color="appendIconColor" v-on="on" v-bind="attrs">{{
-                    appendIcon
-                  }}</v-icon>
-                </v-scroll-x-transition>
-              </template>
-              <span>{{ appendIconTooltip }}</span>
-            </v-tooltip>
+          <v-tooltip bottom>
+            <template v-slot:activator="{ on, attrs }">
+              <v-scroll-x-transition>
+                <v-icon
+                  v-if="appendIcon"
+                  :color="appendIconColor"
+                  v-on="on"
+                  v-bind="attrs"
+                  >{{ appendIcon }}</v-icon
+                >
+              </v-scroll-x-transition>
+            </template>
+            <span>{{ appendIconTooltip }}</span>
+          </v-tooltip>
         </template>
       </v-text-field>
       <div
@@ -255,7 +259,12 @@ export default {
     },
     appendIconTooltip() {
       return (
-        { $success: this.$t("alsijil.coursebook.summary.topic.status.success"), $error: this.$t("alsijil.coursebook.summary.topic.status.error", { error: this.topicError }) }[this.appendIcon] || ""
+        {
+          $success: this.$t("alsijil.coursebook.summary.topic.status.success"),
+          $error: this.$t("alsijil.coursebook.summary.topic.status.error", {
+            error: this.topicError,
+          }),
+        }[this.appendIcon] || ""
       );
     },
   },
diff --git a/aleksis/apps/alsijil/rules.py b/aleksis/apps/alsijil/rules.py
index 7045b2d03..b7fa4d04a 100644
--- a/aleksis/apps/alsijil/rules.py
+++ b/aleksis/apps/alsijil/rules.py
@@ -12,8 +12,8 @@ from aleksis.core.util.predicates import (
 
 from .util.predicates import (
     can_edit_documentation,
-    can_view_documentation,
     can_view_any_documentation,
+    can_view_documentation,
     has_lesson_group_object_perm,
     has_person_group_object_perm,
     has_personal_note_group_perm,
diff --git a/aleksis/apps/alsijil/util/predicates.py b/aleksis/apps/alsijil/util/predicates.py
index c81468053..33bda1e7d 100644
--- a/aleksis/apps/alsijil/util/predicates.py
+++ b/aleksis/apps/alsijil/util/predicates.py
@@ -1,7 +1,7 @@
 from typing import Any, Union
 
 from django.contrib.auth.models import User
-from django.db.models import Prefetch, Q
+from django.db.models import Q
 from django.utils.timezone import localdate, localtime
 
 from rules import predicate
-- 
GitLab