Fix broken joinedload and import path in reviews/activities endpoints

joinedload("reviewer") used a string instead of a class-bound
attribute (rejected by SQLAlchemy 2.x), and models.submission was the
wrong import path for Submission. Both endpoints 500'd whenever
actually called; surfaced while wiring real dashboard/activity data
into the frontend.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 04:46:43 +08:00
parent 61ee1a7364
commit c63a71883b
9 changed files with 2 additions and 1074 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ async def get_pending_reviews(
query = db.query(Submission).options(
joinedload(Submission.user),
joinedload(Submission.task).joinedload(Task.project),
joinedload(Submission.reviews).joinedload("reviewer")
joinedload(Submission.reviews).joinedload(Review.reviewer)
).join(Task).filter(
Submission.deleted_at.is_(None),
Task.deleted_at.is_(None)