Fix institution profile field normalization and specialization handling
Implemented backend normalization improvements for institution profile fields to ensure consistent formatting and preserve specialization input exactly as provided by the user.
Changes Made
University Name
- Added normalization to always store and return university names in FULL UPPERCASE.
Example:
-
jntuh→JNTUH
Academic Stream
- Added validation and normalization for supported academic streams.
- Academic streams are now stored in Title Case format.
Supported values:
- Engineering
- Life Science & Humanities
- Pre University Course
Examples:
-
engineering→Engineering -
life science & humanities→Life Science & Humanities
College Name
- Added Title Case normalization for institution/college names.
Example:
-
institute OF aeronautical engineering→Institute Of Aeronautical Engineering
Specialization Handling
- Preserved specialization input exactly as entered by the user.
- Removed unintended normalization/transformation.
Examples:
-
CSE AI/ML→CSE AI/ML -
cse ai/ml→cse ai/ml
Additional Improvements
-
Added response-level normalization using Pydantic field validators.
-
Added create/update normalization handling in institution endpoints.
-
Added unit tests for:
- university normalization
- academic stream validation
- college normalization
- specialization preservation
- update flow validation
Testing
Executed:
uv run pytest tests/unit/api/v1/endpoints/test_institutions_normalization.py
Result:
- Tests passed successfully.
Edited by Manoj Thimmapogu