Skip to content

Conversation

@Misha-Shvets
Copy link
Collaborator

@Misha-Shvets Misha-Shvets commented Jan 30, 2026

Актуализировал status коды + фикс бага с ДНС ошибкой

…SSABLE CONTENT across multiple API routers and tests for consistency.
@milov-dmitriy milov-dmitriy self-requested a review February 3, 2026 09:37
Copy link
Collaborator

@milov-dmitriy milov-dmitriy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в файле tests/test_api/test_network/test_router.py есть 2 места где используется магическое число 422
давай тоже заменим на корректный статус код

@milov-dmitriy milov-dmitriy requested a review from Copilot February 3, 2026 11:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates HTTP status codes from the deprecated 422 UNPROCESSABLE_ENTITY to the standardized 422 UNPROCESSABLE_CONTENT across the codebase, and fixes a DNS-related bug by moving the DNSNotImplementedError exception class to a more appropriate location.

Changes:

  • Updated all occurrences of HTTP_422_UNPROCESSABLE_ENTITY to HTTP_422_UNPROCESSABLE_CONTENT in test files and API routers
  • Refactored DNSNotImplementedError by moving it from app/ldap_protocol/dns/base.py to the exceptions module and importing it where needed
  • Updated the interface subproject commit reference

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_api/test_ldap_schema/test_object_class_router_datasets.py Updated expected status code in test dataset
tests/test_api/test_ldap_schema/test_entity_type_router.py Updated status code assertion in test case
tests/test_api/test_ldap_schema/test_attribute_type_router_datasets.py Updated expected status code in test dataset
tests/test_api/test_dhcp/test_router.py Updated status code assertions across multiple DHCP test cases
tests/test_api/test_auth/test_router.py Updated status code assertions in authentication test cases
interface Updated subproject commit reference
app/ldap_protocol/dns/base.py Moved DNSNotImplementedError to exceptions module and added import
app/api/shadow/router.py Updated error mapping for PasswordPolicyError
app/api/network/utils.py Updated HTTP exception status code
app/api/network/router.py Updated error mappings for network policy errors
app/api/main/dns_router.py Updated error mapping for DNSSetupError
app/api/dhcp/router.py Updated error mapping for DHCPValidatonError
app/api/auth/router_mfa.py Updated error mapping for InvalidCredentialsError
app/api/auth/router_auth.py Updated error mappings for authentication-related errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rimu-stack rimu-stack merged commit 623d8bd into dev Feb 3, 2026
6 checks passed
@rimu-stack rimu-stack deleted the fix_http_exceptions branch February 3, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants