diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b616628a29733a238ff6f107ab84901caa893965..a235b5650da38e148988d6b74c862064ddf1a48e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,9 +81,9 @@ build_test_image: script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker pull $DEV_IMAGE_BASE || true - - docker build --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node . + - docker build --network=host --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node . - docker pull $DEV_IMAGE || true - - docker build --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE . + - docker build --network=host --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE . - docker push $DEV_IMAGE_BASE - docker push $DEV_IMAGE tags: diff --git a/core/views/common_views.py b/core/views/common_views.py index ad6318b1560491b7fca9424b7d29c5bd590cc1ab..6a0dd84634b2cb4be7df1a496c3d74ff95658bcb 100644 --- a/core/views/common_views.py +++ b/core/views/common_views.py @@ -334,10 +334,6 @@ class UserAccountViewSet(viewsets.ReadOnlyModelViewSet): @action(detail=True, methods=['patch'], permission_classes=(IsReviewer,)) def change_groups(self, request, *args, **kwargs): - print("\n data: ") - print(request.data) - print("\n") - print(type("hi")) # for some reason only the newly added groups come as a group object groups = [x.get('pk') if type(x) is not str else x for x in request.data] req_user = request.user @@ -357,8 +353,6 @@ class UserAccountViewSet(viewsets.ReadOnlyModelViewSet): if req_user.is_student() or req_user.is_tutor(): return Response(status.HTTP_403_FORBIDDEN) user = self.get_object() - print("\n\n\n Data: \n") - print(type(user.exercise_groups)) user_groups = [GroupSerializer(group) for group in user.exercise_groups.all()] return Response(user.exercise_groups, status=status.HTTP_200_OK) diff --git a/frontend/src/components/tutor_list/TutorList.vue b/frontend/src/components/tutor_list/TutorList.vue index 758278c491b072a262836810f5a5c7ba449c5f2b..dd60bc3c63e86577c501378a58d04432221661bd 100644 --- a/frontend/src/components/tutor_list/TutorList.vue +++ b/frontend/src/components/tutor_list/TutorList.vue @@ -43,10 +43,11 @@ label="Set Groups" single-line return-object - flat - class="mr-6" multiple chips + dense + hide-details + filled @change="setExerciseGroups($event, item)" /> </template> @@ -130,8 +131,7 @@ export default class TutorList extends Vue { get tutors () { var tlist = TutorOverview.state.tutors.map(tutor => { - var groups: Group[] - groups = [] + var groups: Group[] = [] this.userAccountGroups(tutor).then(function(value) { groups = value // Success! }, function(reason) { @@ -139,31 +139,16 @@ export default class TutorList extends Vue { return [] }) const reservedSubmissions = TutorOverview.state.activeAssignments[tutor.pk] - //console.log(groups) return { ...tutor, reservedSubmissions: reservedSubmissions ? reservedSubmissions.length : 0, } }) - console.log(tlist) return tlist } - get groups () { - return Assignments.state.groups.slice().sort((a, b) => { - const matches_a = a.name.match(/(\d+)/) - const number_a = Number(matches_a === null ? 0 : matches_a[1]) - - const matches_b = b.name.match(/(\d+)/) - const number_b = Number(matches_b === null ? 0 : matches_b[1]) - - return (number_a<number_b?-1:(number_a>number_b?1:0)) - }) - } - async userAccountGroups(tutor: Tutor) { const groups = await (await fetchUser(tutor.pk)).exerciseGroups - console.log(groups) return groups }