Skip to content

Fix Python execution order: move unregister endpoint after activities dict#4

Merged
pmca31 merged 2 commits intoaccelerate-with-copilotfrom
copilot/sub-pr-2-again
Feb 10, 2026
Merged

Fix Python execution order: move unregister endpoint after activities dict#4
pmca31 merged 2 commits intoaccelerate-with-copilotfrom
copilot/sub-pr-2-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

The unregister endpoint referenced the activities dictionary before it was defined, violating Python's execution order.

Changes

  • Moved /activities/{activity_name}/unregister endpoint definition from line 24 (before activities dict) to line 113 (after signup endpoint)
  • Added docstring for consistency with other endpoints
# Before: endpoint defined at line 24, activities dict at line 35
@app.post("/activities/{activity_name}/unregister")
async def unregister_from_activity(activity_name: str, email: str):
    if activity_name not in activities:  # NameError: activities not defined yet
        ...

# After: activities dict at line 25, endpoint at line 113
activities = { ... }

@app.post("/activities/{activity_name}/unregister")
async def unregister_from_activity(activity_name: str, email: str):
    if activity_name not in activities:  # Now references defined dict
        ...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pmca31 <6774003+pmca31@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on 'Accelerate with copilot' pull request Fix Python execution order: move unregister endpoint after activities dict Feb 10, 2026
Copilot AI requested a review from pmca31 February 10, 2026 17:01
@pmca31 pmca31 marked this pull request as ready for review February 10, 2026 17:02
@pmca31 pmca31 merged commit 26a9418 into accelerate-with-copilot Feb 10, 2026
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.

2 participants