feat: store assigment user
This commit is contained in:
parent
9e31975d76
commit
5ee6cc2596
|
|
@ -123,3 +123,16 @@ export async function handleCockpit(to: RouteLocationNormalized) {
|
|||
return "/";
|
||||
}
|
||||
}
|
||||
|
||||
export async function handleAcceptLearningMentorInvitation(
|
||||
to: RouteLocationNormalized
|
||||
) {
|
||||
const user = useUserStore();
|
||||
if (user.loggedIn) {
|
||||
return;
|
||||
}
|
||||
|
||||
return `/onboarding/vv-${user.language}/account/create?next=${encodeURIComponent(
|
||||
to.fullPath
|
||||
)}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import DashboardPage from "@/pages/dashboard/DashboardPage.vue";
|
||||
import LoginPage from "@/pages/LoginPage.vue";
|
||||
import {
|
||||
handleAcceptLearningMentorInvitation,
|
||||
handleCockpit,
|
||||
handleCourseSessionAsQueryParam,
|
||||
handleCurrentCourseSession,
|
||||
|
|
@ -132,6 +133,11 @@ const router = createRouter({
|
|||
path: "/lernbegleitung/:courseId/invitation/:invitationId",
|
||||
component: () => import("@/pages/learningMentor/InvitationAcceptPage.vue"),
|
||||
props: true,
|
||||
beforeEnter: handleAcceptLearningMentorInvitation,
|
||||
meta: {
|
||||
// The login redirect is handled in the beforeEnter guard
|
||||
public: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/course/:courseSlug/cockpit",
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export const useDashboardStore = defineStore("dashboard", () => {
|
|||
const loadDashboardConfig = async () => {
|
||||
if (dashboardConfigs.value.length > 0) return;
|
||||
const configData = await fetchDashboardConfig();
|
||||
if (configData) {
|
||||
if (configData && configData.length > 0) {
|
||||
dashboardConfigs.value = configData;
|
||||
await switchAndLoadDashboardConfig(configData[0]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ def update_assignment_completion(
|
|||
if completion_status == AssignmentCompletionStatus.SUBMITTED:
|
||||
ac.submitted_at = timezone.now()
|
||||
if evaluation_user:
|
||||
ac.evaluation_user = evaluation_user
|
||||
NotificationService.send_assignment_submitted_notification(
|
||||
recipient=evaluation_user,
|
||||
sender=ac.assignment_user,
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
user_text_input0 = subtasks[0]
|
||||
user_text_input1 = subtasks[1]
|
||||
|
||||
ac = AssignmentCompletion.objects.create(
|
||||
AssignmentCompletion.objects.create(
|
||||
assignment_user=self.user,
|
||||
assignment=self.assignment,
|
||||
course_session=self.course_session,
|
||||
|
|
@ -163,6 +163,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
assignment=self.assignment,
|
||||
course_session=self.course_session,
|
||||
completion_status=AssignmentCompletionStatus.SUBMITTED,
|
||||
evaluation_user=self.trainer,
|
||||
)
|
||||
|
||||
ac = AssignmentCompletion.objects.get(
|
||||
|
|
@ -173,6 +174,7 @@ class UpdateAssignmentCompletionTestCase(TestCase):
|
|||
|
||||
self.assertEqual(ac.completion_status, "SUBMITTED")
|
||||
self.assertEqual(ac.submitted_at.date(), date.today())
|
||||
self.assertEqual(ac.evaluation_user, self.trainer)
|
||||
|
||||
# will create AssignmentCompletionAuditLog entry
|
||||
acl = AssignmentCompletionAuditLog.objects.get(
|
||||
|
|
|
|||
Loading…
Reference in New Issue