|
6 | 6 | from django.shortcuts import get_object_or_404 |
7 | 7 | from drf_spectacular.utils import extend_schema_serializer |
8 | 8 | from rest_framework import serializers |
| 9 | +from services.crisalid.serializers import ResearcherSerializerLight |
| 10 | +from services.translator.serializers import AutoTranslatedModelSerializer |
9 | 11 |
|
10 | 12 | from apps.commons.fields import ( |
11 | 13 | HiddenPrimaryKeyRelatedField, |
|
28 | 30 | from apps.projects.models import Project |
29 | 31 | from apps.skills.models import Skill |
30 | 32 | from apps.skills.serializers import SkillLightSerializer, TagSerializer |
31 | | -from services.crisalid.serializers import ResearcherSerializerLight |
32 | | -from services.translator.serializers import AutoTranslatedModelSerializer |
33 | 33 |
|
34 | 34 | from .exceptions import ( |
35 | 35 | FeaturedProjectPermissionDeniedError, |
@@ -432,7 +432,7 @@ class PeopleGroupSerializer( |
432 | 432 | slug_field="code", queryset=Organization.objects.all() |
433 | 433 | ) |
434 | 434 | hierarchy = serializers.SerializerMethodField() |
435 | | - children = serializers.SerializerMethodField() |
| 435 | + # children = serializers.SerializerMethodField() |
436 | 436 | parent = serializers.PrimaryKeyRelatedField( |
437 | 437 | queryset=PeopleGroup.objects.all(), |
438 | 438 | required=False, |
@@ -466,19 +466,6 @@ def get_hierarchy(self, obj: PeopleGroup) -> list[dict[str, str | int]]: |
466 | 466 | ) |
467 | 467 | return [{"order": i, **h} for i, h in enumerate(hierarchy[::-1])] |
468 | 468 |
|
469 | | - def get_children(self, obj: PeopleGroup) -> list[dict[str, str | int]]: |
470 | | - request = self.context.get("request") |
471 | | - queryset = ( |
472 | | - request.user.get_people_group_queryset() |
473 | | - .select_related("organization") |
474 | | - .filter(parent=obj) |
475 | | - .order_by("name") |
476 | | - .distinct() |
477 | | - ) |
478 | | - return PeopleGroupSuperLightSerializer( |
479 | | - queryset, many=True, context=self.context |
480 | | - ).data |
481 | | - |
482 | 469 | def validate_featured_projects(self, projects: list[Project]) -> list[Project]: |
483 | 470 | request = self.context.get("request") |
484 | 471 | if not all(request.user.can_see_project(project) for project in projects): |
@@ -556,7 +543,6 @@ class Meta: |
556 | 543 | "parent", |
557 | 544 | "organization", |
558 | 545 | "hierarchy", |
559 | | - "children", |
560 | 546 | "header_image", |
561 | 547 | "logo_image", |
562 | 548 | "roles", |
|
0 commit comments