Skip to content

fix: remove duplicate _unique_google_username function definition#788

Open
NaitikVerma6776 wants to merge 1 commit into
param20h:devfrom
NaitikVerma6776:fix/remove-duplicate-unique-google-username
Open

fix: remove duplicate _unique_google_username function definition#788
NaitikVerma6776 wants to merge 1 commit into
param20h:devfrom
NaitikVerma6776:fix/remove-duplicate-unique-google-username

Conversation

@NaitikVerma6776

Copy link
Copy Markdown
Contributor

🔗 Related Issue

Closes #786


📝 What does this PR do?

Removes a duplicate definition of _unique_google_username in backend/app/routes/auth.py.

The function was defined twice in the same file:

  • First definition: line 166
  • Second definition: line 682

Python silently uses the last definition when a function is defined twice in the same module. This means the first definition at line 166 was dead code — never actually executed, but present as a maintenance trap. If someone edited one copy without updating the other, the two definitions could silently diverge and cause hard-to-debug behaviour.

Fix: Removed the first (duplicate) definition at line 166, keeping only the second definition at line 682 which is consistent with the rest of the file's style and is what Python was already using at runtime.


🗂️ Type of Change

  • 🔧 Refactor / code cleanup

🧪 How was this tested?

  • Verified only one definition remains after removal:
    Select-String -Path backend/app/routes/auth.py -Pattern "def _unique_google_username" → one result ✅
  • Both call sites (line 309 Google OAuth, line 971
    HuggingFace OAuth) continue to resolve to the
    remaining definition ✅
  • No logic was changed — purely dead code removal ✅

📸 Screenshots

N/A — backend-only cleanup, no UI change


⚠️ Anything to flag for reviewers?

Single file changed, single function block removed.
No logic, imports, or call sites were modified.
This is purely dead code cleanup.


✅ Self-Review Checklist

  • My branch is based on dev, not main
  • I have not added any secrets / API keys
  • I have not modified main branch or any
    HuggingFace deployment config
  • My code follows the existing style
    (no unnecessary formatting changes)
  • I have updated relevant docs / comments if needed

@NaitikVerma6776 NaitikVerma6776 requested a review from param20h as a code owner July 3, 2026 06:39
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@NaitikVerma6776 is attempting to deploy a commit to the param20h's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Duplicate _unique_google_username function definition in auth.py causes silent dead code

1 participant