From 65ed9f9f70e8fbc65f8793e18e27d5772d6fde0d Mon Sep 17 00:00:00 2001 From: Milov Dmitriy Date: Thu, 9 Apr 2026 14:42:56 +0300 Subject: [PATCH 1/2] refactor: replace lDAPDisplayName to dir.name task_1488 --- .../ldap_schema/attribute_type/attribute_type_dao.py | 2 +- interface | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 From ca13571896d4276759064d3a4cf4d8fb4859f54c Mon Sep 17 00:00:00 2001 From: Milov Dmitriy Date: Thu, 9 Apr 2026 15:03:19 +0300 Subject: [PATCH 2/2] add: test for name vs ldap display name task_1258 --- .../test_ldap_schema/test_attribute_type_router.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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,