Review fixes for the Affiliation Catalogs plugin#1
Closed
moliholy wants to merge 8 commits into
Closed
Conversation
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.
This PR applies the fixes from a review of indico#6 (Affiliation Catalogs). It targets the PR branch (
affiliation-schemas) so the diff is only the fixes.What this fixes
Correctness
Performance
get_all_catalogsonce per ancestor category; it resolves the whole chain in a single query. This path runs on every registration form render.Client
dashboard/types.tsmodule whose only import pointed at a nonexistent path.Robustness and polish
models/__init__.pynow imports every model, so importing the package registers all SQLAlchemy mappers regardless of import order._()for translation.conftest.pythat mocks the plugin webpack manifest so management pages render in tests. This is the fix for the failingtest-plugin (affiliation_extras)CI job (assets are not built in CI).Verification
pytest: 73 passed (includes 2 new regression tests).ruff checkandruff format --check: clean, run against the core branch from Add "Affiliation" field type for registration forms indico/indico#7352.Note: the base here is
affiliation-schemas, notmaster, so the repo's CI (which only runs on PRs targetingmaster/*.x) will not trigger automatically. Everything above was verified locally.Deliberately not changed (need a decision)