diff --git a/client/src/pages/userProfile/UserProfilePage.vue b/client/src/pages/userProfile/UserProfilePage.vue index cf27137e..b2d49465 100644 --- a/client/src/pages/userProfile/UserProfilePage.vue +++ b/client/src/pages/userProfile/UserProfilePage.vue @@ -55,7 +55,12 @@ onMounted(() => {

{{ user.email }}

{{ $t("a.Teilnehmer") }} - + {{ $t("a.Optionale Anwesenheit") }}

diff --git a/server/vbv_lernwelt/api/tests/test_profile.py b/server/vbv_lernwelt/api/tests/test_profile.py index b5b68f70..453e479f 100644 --- a/server/vbv_lernwelt/api/tests/test_profile.py +++ b/server/vbv_lernwelt/api/tests/test_profile.py @@ -71,6 +71,6 @@ class ProfileViewTest(APITestCase): "organisation_postal_code": "", "organisation_city": "", "organisation_country": None, - "optional_attendance": False, + "optional_attendance": [], }, ) diff --git a/server/vbv_lernwelt/core/serializers.py b/server/vbv_lernwelt/core/serializers.py index d099c6ee..ba43e949 100644 --- a/server/vbv_lernwelt/core/serializers.py +++ b/server/vbv_lernwelt/core/serializers.py @@ -111,9 +111,10 @@ class UserSerializer(serializers.ModelSerializer): return [str(_id) for _id in (supervisor_in_session_ids | expert_in_session_ids)] def get_optional_attendance(self, obj: User) -> bool: - return CourseSessionUser.objects.filter( + optional_attendance_ids = CourseSessionUser.objects.filter( user=obj, optional_attendance=True ).values_list("course_session__id", flat=True) + return [str(id) for id in optional_attendance_ids] def update(self, instance, validated_data): country_data = validated_data.pop("country", None)