Repository navigation
Conversation
This branch has not been deployed
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.
What GitHub issue does this PR apply to?
Resolves #826
What changed and why?
The
check_conceptsmethod invalidatelanginfofiles.pypreviously assumed that theconceptsfield in a language JSON file is always a dictionary (concepts.items()). When a malformed file contained a non-dictionary data type (such as a list, string, ornull), the command crashed with an unhandledAttributeErrorinstead of reporting a validation error and continuing.This PR:
isinstance(concepts, dict)tocheck_concepts. Ifconceptsis not an object/mapping, it logs an error in the project's standard format ([Error] \` has a `concepts` section that is not an object`) and safely returns.web/tests/test_validatelanginfofiles_regression.pytesting non-dict inputs (list,str,None) to verify error reporting and crash prevention.AI bots used in the process of making this PR
Google Antigravity & OpenAI ChatGPT were used for codebase exploration, reproducing the issue, and structuring the regression test suite. All code, tests, and diffs were reviewed and verified locally.
Checklist
Any additional comments or things to be aware of while reviewing?
All 130 tests pass locally (
python manage.py test web).