Skip to content

Fix institution profile field normalization and specialization handling

Manoj Thimmapogu requested to merge fix/institution-field-normalization into develop

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:

  • jntuhJNTUH

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:

  • engineeringEngineering

  • life science & humanitiesLife Science & Humanities


College Name

  • Added Title Case normalization for institution/college names.

Example:

  • institute OF aeronautical engineeringInstitute Of Aeronautical Engineering

Specialization Handling

  • Preserved specialization input exactly as entered by the user.
  • Removed unintended normalization/transformation.

Examples:

  • CSE AI/MLCSE AI/ML

  • cse ai/mlcse 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

Merge request reports

Loading