Skip to content

Commit dbe45ca

Browse files
committed
[OS-1739] Add the language to the supervision members dtos to fix the external member form
1 parent dd1a789 commit dbe45ca

File tree

9 files changed

+17
-2
lines changed

9 files changed

+17
-2
lines changed

api/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# ##############################################################################
2626
from drf_spectacular.generators import SchemaGenerator
2727

28-
ADMISSION_SDK_VERSION = "1.1.16"
28+
ADMISSION_SDK_VERSION = "1.1.16.dev1739"
2929

3030

3131
class AdmissionSchemaGenerator(SchemaGenerator):

ddd/admission/doctorat/preparation/dtos/groupe_supervision.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class PromoteurDTO(interface.DTO):
4545
code_pays: str = ""
4646
pays: str = ""
4747
est_externe: bool = False
48+
langue: str = ''
4849

4950

5051
@attr.dataclass(frozen=True, slots=True)
@@ -60,6 +61,7 @@ class MembreCADTO(interface.DTO):
6061
code_pays: str = ""
6162
pays: str = ""
6263
est_externe: bool = False
64+
langue: str = ''
6365

6466

6567
@attr.dataclass(frozen=True, slots=True)

infrastructure/admission/doctorat/preparation/domain/service/in_memory/membre_CA.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class MembreCA:
4343
institution: str = ''
4444
ville: str = ''
4545
pays: str = ''
46+
langue: str = 'fr-be'
4647

4748

4849
class MembreCAInMemoryTranslator(IMembreCATranslator):
@@ -87,6 +88,7 @@ def get_dto(cls, membre_ca_id: 'MembreCAIdentity') -> 'MembreCADTO':
8788
institution=p.institution,
8889
ville=p.ville,
8990
pays=p.pays,
91+
langue=p.langue,
9092
)
9193
except StopIteration: # pragma: no cover
9294
raise MembreCANonTrouveException

infrastructure/admission/doctorat/preparation/domain/service/in_memory/promoteur.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def _build_dto_from_model(cls, promoteur: 'Promoteur') -> 'PromoteurDTO':
115115
ville=promoteur.ville,
116116
pays=promoteur.pays,
117117
est_externe=promoteur.externe,
118+
langue=promoteur.langue,
118119
)
119120

120121
@classmethod

infrastructure/admission/doctorat/preparation/domain/service/membre_CA.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def get_dto(cls, membre_ca_id: 'MembreCAIdentity') -> MembreCADTO:
7373
code_pays=actor.country_id and actor.country.iso_code or '',
7474
pays=actor.country_id and getattr(actor.country, 'name_en' if get_language() == 'en' else 'name') or '',
7575
est_externe=actor.is_external,
76+
langue=actor.language,
7677
)
7778

7879
@classmethod

infrastructure/admission/doctorat/preparation/domain/service/promoteur.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def _build_dto_from_model(cls, actor: 'SupervisionActor') -> 'PromoteurDTO':
7878
code_pays=actor.country_id and actor.country.iso_code or '',
7979
pays=actor.country_id and getattr(actor.country, 'name_en' if get_language() == 'en' else 'name') or '',
8080
est_externe=actor.is_external,
81+
langue=actor.language,
8182
)
8283

8384
@classmethod

infrastructure/admission/doctorat/preparation/repository/groupe_de_supervision.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ def get_members(cls, groupe_id: 'GroupeDeSupervisionIdentity') -> List[Union['Pr
374374
and getattr(actor.country, 'name_en' if get_language() == 'en' else 'name')
375375
or '',
376376
est_externe=actor.is_external,
377+
langue=actor.language,
377378
)
378379
)
379380
return members

infrastructure/admission/doctorat/preparation/repository/in_memory/groupe_de_supervision.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,5 @@ def initialize_supervision_group_from_proposition(
312312
institute=member.institution,
313313
city=member.ville,
314314
country_code=member.code_pays,
315+
language=member.langue,
315316
)

schema.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.3
22
info:
33
title: Admission API
4-
version: 1.1.16
4+
version: 1.1.16.dev1739
55
description: This API delivers data for the Admission project.
66
contact:
77
name: UCLouvain - OSIS
@@ -9541,12 +9541,15 @@ components:
95419541
type: string
95429542
est_externe:
95439543
type: boolean
9544+
langue:
9545+
type: string
95449546
required:
95459547
- code_pays
95469548
- email
95479549
- est_docteur
95489550
- est_externe
95499551
- institution
9552+
- langue
95509553
- nom
95519554
- pays
95529555
- prenom
@@ -10245,12 +10248,15 @@ components:
1024510248
type: string
1024610249
est_externe:
1024710250
type: boolean
10251+
langue:
10252+
type: string
1024810253
required:
1024910254
- code_pays
1025010255
- email
1025110256
- est_docteur
1025210257
- est_externe
1025310258
- institution
10259+
- langue
1025410260
- nom
1025510261
- pays
1025610262
- prenom

0 commit comments

Comments
 (0)