diff --git a/app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py b/app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py index 937ee225b..fc5bf344f 100644 --- a/app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py +++ b/app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py @@ -22,7 +22,7 @@ def _convert_model_to_dto(directory: Directory) -> AttributeTypeDTO[int]: return AttributeTypeDTO[int]( id=directory.id, - name=directory.attributes_dict[Names.LDAP_DISPLAY_NAME][0], + name=directory.name, ldap_display_name=directory.attributes_dict[Names.LDAP_DISPLAY_NAME][0], oid=directory.attributes_dict[Names.OID][0], syntax=directory.attributes_dict[Names.SYNTAX][0], diff --git a/interface b/interface index 61e15e236..046449cdd 160000 --- a/interface +++ b/interface @@ -1 +1 @@ -Subproject commit 61e15e2367182a3e706c94cf8e1895d742840aa7 +Subproject commit 046449cdd568919cca12a7939366dcee7a54fdfa diff --git a/tests/test_api/test_ldap_schema/test_attribute_type_router.py b/tests/test_api/test_ldap_schema/test_attribute_type_router.py index d7370cb9a..18ae827d1 100644 --- a/tests/test_api/test_ldap_schema/test_attribute_type_router.py +++ b/tests/test_api/test_ldap_schema/test_attribute_type_router.py @@ -78,6 +78,18 @@ async def test_create_attribute_type_conflict_when_already_exists( assert response.status_code == status.HTTP_400_BAD_REQUEST +@pytest.mark.asyncio +async def test_get_attribute_type_returns_directory_name( + http_client: AsyncClient, +) -> None: + """Test name vs ldap_display_name for attribute type responses.""" + response = await http_client.get("/schema/attribute_type/attr_with_bvalue") + assert response.status_code == status.HTTP_200_OK + data = response.json() + assert data.get("name") == "attr_with_bvalue" + assert data.get("ldap_display_name") == "attrWithBvalue" + + @pytest.mark.asyncio async def test_get_list_attribute_types_with_pagination( http_client: AsyncClient,