🐛 Bug Description
backend/app/routes/auth.py defines the helper function
_unique_google_username twice in the same module:
- First definition: line 166
- Second definition: line 682
Python silently uses the last definition when a function is defined twice — meaning the first definition at line
166 is dead code that is never actually executed, despite appearing to be valid and active code.
📍 Where it happens
File: backend/app/routes/auth.py
# Line 166 — DEAD CODE (never executed)
def _unique_google_username(email: str, db: Session) -> str:
...
# Line 309 — calls the function (resolves to line 682)
username = _unique_google_username(email, db)
# Line 682 — actual definition Python uses at runtime
def _unique_google_username(email: str, db: Session) -> str:
...
# Line 971 — calls the function (resolves to line 682)
username = _unique_google_username(email, db)
⚠️ Why This Is a Problem
If a developer edits the first definition (line 166) assuming it's the active one, their change will have
zero effect at runtime — Python silently ignores it. The two definitions could also silently diverge over
time, creating confusing and hard-to-debug behaviour.
✅ Proposed Fix
Remove the first (duplicate) definition at line 166, keeping only the second definition at line 682 which
is what Python was already using at runtime.
No logic changes required — purely dead code removal.
📁 Files to Change
backend/app/routes/auth.py — remove first definition
🤝 GSSoC '26
🐛 Bug Description
backend/app/routes/auth.pydefines the helper function_unique_google_usernametwice in the same module:Python silently uses the last definition when a function is defined twice — meaning the first definition at line
166 is dead code that is never actually executed, despite appearing to be valid and active code.
📍 Where it happens
File:
backend/app/routes/auth.pyIf a developer edits the first definition (line 166) assuming it's the active one, their change will have
zero effect at runtime — Python silently ignores it. The two definitions could also silently diverge over
time, creating confusing and hard-to-debug behaviour.
✅ Proposed Fix
Remove the first (duplicate) definition at line 166, keeping only the second definition at line 682 which
is what Python was already using at runtime.
No logic changes required — purely dead code removal.
📁 Files to Change
backend/app/routes/auth.py— remove first definition🤝 GSSoC '26
Code and would like to fix this.