Fix: HTTP status codes from 422 UNPROCESSABLE ENTITY to 422 UNPROCESSABLE CONTENT#920
Merged
rimu-stack merged 2 commits intodevfrom Feb 3, 2026
Merged
Fix: HTTP status codes from 422 UNPROCESSABLE ENTITY to 422 UNPROCESSABLE CONTENT#920rimu-stack merged 2 commits intodevfrom
rimu-stack merged 2 commits intodevfrom
Conversation
…SSABLE CONTENT across multiple API routers and tests for consistency.
milov-dmitriy
requested changes
Feb 3, 2026
Collaborator
milov-dmitriy
left a comment
There was a problem hiding this comment.
в файле tests/test_api/test_network/test_router.py есть 2 места где используется магическое число 422
давай тоже заменим на корректный статус код
Contributor
There was a problem hiding this comment.
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_ENTITYtoHTTP_422_UNPROCESSABLE_CONTENTin test files and API routers - Refactored
DNSNotImplementedErrorby moving it fromapp/ldap_protocol/dns/base.pyto 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.
… references across the codebase
milov-dmitriy
approved these changes
Feb 3, 2026
rimu-stack
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Актуализировал status коды + фикс бага с ДНС ошибкой