Skip to content

Fix: Remove conflicting global variable redefinitions (#1168) - #1186

Open
desireddymohithreddy0925 wants to merge 12 commits into
komalharshita:mainfrom
desireddymohithreddy0925:fix/issue-1168-duplicate-globals
Open

Fix: Remove conflicting global variable redefinitions (#1168)#1186
desireddymohithreddy0925 wants to merge 12 commits into
komalharshita:mainfrom
desireddymohithreddy0925:fix/issue-1168-duplicate-globals

Conversation

@desireddymohithreddy0925

Copy link
Copy Markdown

Summary

This PR fixes a bug reported in #1168 where validation data was being lost due to conflicting global variable redefinitions. The global variables VALID_LEVELS, VALID_INTERESTS, and VALID_TIME_AVAILABILITY were fully defined at the top of src/utils/recommender.py, but were mistakenly redefined at the bottom of the file with incomplete lists. This caused valid areas of interest, such as "mobile" and "machine learning/ai", to be dropped during backend validation. I have removed the redundant, incorrect definitions at the bottom of the file to ensure the full valid sets are retained.

Related Issue

Closes #1168

Type of Change

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed

File Change made
src/utils/recommender.py Removed lines 381-387 which mistakenly redefined and overwrote VALID_LEVELS, VALID_INTERESTS, and VALID_TIME_AVAILABILITY with incomplete lists.

How to Test This PR

  1. Clone this branch: git checkout fix/issue-1168-duplicate-globals
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Submit the recommendation form with the interest set to "mobile" or "machine learning/ai". The backend should now successfully validate and process the request instead of returning an "Invalid area of interest" error.
  5. Run the tests: python tests/test_basic.py (or pytest tests/test_basic.py)

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results

============================= test session starts ==============================
platform darwin -- Python 3.x.x, pytest-x.x.x, pluggy-x.x.x
rootdir: /Users/desireddymohithreddy/GSSOC2026DevPath/DevPathMRD
collected 27 items                                                             

tests/test_basic.py ...........................                          [100%]

============================== 27 passed in 0.12s ==============================

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

None

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc-2026 type:bug Something isn't working labels Jun 26, 2026
@komalharshita

Copy link
Copy Markdown
Owner

@desireddymohithreddy0925 kindly resolve the merge conflicts

@komalharshita komalharshita added the need review Further information is requested label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data gssoc-2026 need review Further information is requested type:bug Something isn't working type:testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Conflicting global variable redefinitions cause validation data loss

2 participants