generated from nyjc-computing/replit-flask-app
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
POST /assignments/ endpoint returns 500 error when creating an assignment.
Root Cause
In campus/api/routes/assignments.py:85:
if not current_user or not current_user.get('id'):The code tries to call .get('id') on current_user, but current_user is a User object, not a dict. This causes an AttributeError: 'User' object has no attribute 'get'.
Expected Behavior
The endpoint should return 201 Created with the new assignment resource.
Actual Behavior
The endpoint returns 500 Internal Server Error.
Related Issues
- Bug: POST /submissions/{id}/feedback returns 500 - current_user is User object not dict #327: Same bug pattern in POST /submissions/{id}/feedback endpoint
Fix
Change current_user.get('id') to current_user.id (User objects have an id attribute).
Test Coverage
Contract test created in tests/contract/test_api_submissions.py with 3 tests skipped for this bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working