Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/api/auth/router_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
translator=translator,
),
PasswordPolicyError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
UserNotFoundError: rule(
status=status.HTTP_400_BAD_REQUEST,
translator=translator,
),
AuthValidationError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
MFARequiredError: rule(
Expand Down
2 changes: 1 addition & 1 deletion app/api/auth/router_mfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
translator=translator,
),
InvalidCredentialsError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
NotFoundError: rule(
Expand Down
2 changes: 1 addition & 1 deletion app/api/dhcp/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
translator=translator,
),
DHCPValidatonError: rule(
Comment thread
Misha-Shvets marked this conversation as resolved.
Outdated
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
DHCPOperationError: rule(
Expand Down
2 changes: 1 addition & 1 deletion app/api/main/dns_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

error_map: ERROR_MAP_TYPE = {
dns_exc.DNSSetupError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
dns_exc.DNSRecordCreateError: rule(
Expand Down
4 changes: 2 additions & 2 deletions app/api/network/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@

error_map: ERROR_MAP_TYPE = {
NetworkPolicyAlreadyExistsError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
NetworkPolicyNotFoundError: rule(
status=status.HTTP_400_BAD_REQUEST,
translator=translator,
),
LastActivePolicyError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
}
Expand Down
2 changes: 1 addition & 1 deletion app/api/network/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ async def check_policy_count(session: AsyncSession) -> None:

if count.one() == 1:
raise HTTPException(
status.HTTP_422_UNPROCESSABLE_ENTITY,
status.HTTP_422_UNPROCESSABLE_CONTENT,
"At least one policy should be active",
)
2 changes: 1 addition & 1 deletion app/api/shadow/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
translator=translator,
),
PasswordPolicyError: rule(
status=status.HTTP_422_UNPROCESSABLE_ENTITY,
status=status.HTTP_422_UNPROCESSABLE_CONTENT,
translator=translator,
),
PermissionError: rule(
Expand Down
6 changes: 1 addition & 5 deletions app/ldap_protocol/dns/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from ldap_protocol.dns.dto import DNSSettingDTO

from .exceptions import DNSSetupError
from .exceptions import DNSNotImplementedError, DNSSetupError

DNS_MANAGER_STATE_NAME = "DNSManagerState"
DNS_MANAGER_ZONE_NAME = "DNSManagerZoneName"
Expand Down Expand Up @@ -46,10 +46,6 @@ class DNSForwarderServerStatus(StrEnum):
NOT_FOUND = "not found"


class DNSNotImplementedError(NotImplementedError):
"""API Not Implemented Error."""


class DNSRecordType(StrEnum):
"""DNS record types."""

Expand Down
2 changes: 1 addition & 1 deletion interface
4 changes: 2 additions & 2 deletions tests/test_api/test_auth/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async def test_first_setup_with_invalid_domain(
"/auth/setup",
json=test_case,
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT

response = await unbound_http_client.get("/auth/setup")
assert response.status_code == status.HTTP_200_OK
Expand Down Expand Up @@ -384,7 +384,7 @@ async def test_update_password_with_empty_old_password(
},
)

assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT

new_auth = await http_client.post(
"auth/",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_api/test_dhcp/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async def test_create_subnet_invalid_data(
json=invalid_data,
)

assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT


@pytest.mark.asyncio
Expand Down Expand Up @@ -297,7 +297,7 @@ async def test_create_lease_invalid_data(
json=invalid_data,
)

assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT


@pytest.mark.asyncio
Expand Down Expand Up @@ -486,7 +486,7 @@ async def test_create_reservation_invalid_data(
json=invalid_data,
)

assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT


@pytest.mark.asyncio
Expand Down Expand Up @@ -597,7 +597,7 @@ async def test_delete_reservation_missing_params(
"""Test reservation deletion with missing parameters."""
response = await http_client.delete("/dhcp/reservation")

assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@
{
"attribute_type_schemas": [],
"attribute_types_deleted": [],
"status_code": status.HTTP_422_UNPROCESSABLE_ENTITY,
"status_code": status.HTTP_422_UNPROCESSABLE_CONTENT,
},
]
2 changes: 1 addition & 1 deletion tests/test_api/test_ldap_schema/test_entity_type_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def test_create_one_entity_type_value_422(
"is_system": False,
},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT


@pytest.mark.parametrize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
{
"object_class_datas": [],
"object_classes_deleted": [],
"status_code": status.HTTP_422_UNPROCESSABLE_ENTITY,
"status_code": status.HTTP_422_UNPROCESSABLE_CONTENT,
},
{
"object_class_datas": [
Expand Down
Loading