wip: to be reverted

This commit is contained in:
Livio Bieri 2023-10-26 18:32:19 +02:00
parent 7c00ac1681
commit e55cb31e9f
2 changed files with 21 additions and 1 deletions

View File

@ -62,6 +62,9 @@ export function useCourseSessionDetailQuery(courSessionId?: string) {
}, },
}); });
// TODO: Why is this always empty??????!!!!!
// console.log(queryResult.data.value?.course_session);
const courseSessionDetail = computed(() => { const courseSessionDetail = computed(() => {
return queryResult.data.value?.course_session as CourseSessionDetail | undefined; return queryResult.data.value?.course_session as CourseSessionDetail | undefined;
}); });

View File

@ -211,4 +211,21 @@ class CourseSessionObjectType(DjangoObjectType):
return CourseSessionEdoniqTest.objects.filter(course_session=self) return CourseSessionEdoniqTest.objects.filter(course_session=self)
def resolve_users(self, info): def resolve_users(self, info):
return CourseSessionUser.objects.filter(course_session_id=self.id).distinct() csu = list(CourseSessionUser.objects.filter(course_session_id=self.id).distinct())
# TODO remove or fix this
# HACK: This is an ugly hack to pretend supervisor is a course session expert
# if CourseSessionGroup.objects.filter(
# course_session=self.id, supervisor=info.context.user
# ).exists():
# print()
# csu = [CourseSessionUser(
# id=info.context.user.id,
# user=info.context.user,
# role=CourseSessionUser.Role.EXPERT,
# )] + csu
#
# for user in csu:
# print(user.id)
return csu