Fix query in assigning group to term of defence

This commit is contained in:
adam-skowronek 2022-11-18 11:39:12 +01:00
parent bd99609de2
commit 4d21532b1f

View File

@ -28,7 +28,7 @@ def assign_your_group_to_term_of_defence(examination_schedule_id: int, term_of_d
if term_of_defence is None or ex is None:
abort(400, "Term of defence not found!")
g = Group.query.join(ProjectSupervisor).filter(Group.year_group_id == examination_schedule_id). \
g = Group.query.join(ProjectSupervisor).filter(Group.year_group_id == ex.year_group_id). \
join(Group.students).filter_by(index=student.index).first()
if g is None or g.project_supervisor is None:
abort(400, "You don't have a group or your group doesn't have an assigned project supervisor!")