diff --git a/backend/db/implementation/SqlGroupDAO.py b/backend/db/implementation/SqlGroupDAO.py index d26113ff..115d99d7 100644 --- a/backend/db/implementation/SqlGroupDAO.py +++ b/backend/db/implementation/SqlGroupDAO.py @@ -12,7 +12,7 @@ def create_group(self, project_id: int) -> GroupDataclass: if not project: msg = f"Project with id {project} not found" raise ItemNotFoundError(msg) - new_group: Group = Group(project_id=project_id, project=project) + new_group: Group = Group(project_id=project_id) db.session.add(new_group) db.session.commit() return new_group.to_domain_model() diff --git a/backend/db/implementation/SqlProjectDAO.py b/backend/db/implementation/SqlProjectDAO.py index d92b350a..6f2bd059 100644 --- a/backend/db/implementation/SqlProjectDAO.py +++ b/backend/db/implementation/SqlProjectDAO.py @@ -15,7 +15,7 @@ def create_project(self, subject_id: int, name: str, deadline: datetime, archive msg = f"Subject with id {subject_id} not found" raise ItemNotFoundError(msg) - new_project: Project = Project(subject_id=subject_id, subject=subject, name=name, deadline=deadline, + new_project: Project = Project(subject_id=subject_id, name=name, deadline=deadline, archived=archived, requirements=requirements, visible=visible, max_students=max_students) diff --git a/backend/db/implementation/SqlSubmissionDAO.py b/backend/db/implementation/SqlSubmissionDAO.py index 3ae862dd..51a101b5 100644 --- a/backend/db/implementation/SqlSubmissionDAO.py +++ b/backend/db/implementation/SqlSubmissionDAO.py @@ -19,7 +19,7 @@ def create_submission(self, student_id: int, group_id: int, message: str,state: if not group: msg = f"Group with id {group_id} not found" raise ItemNotFoundError(msg) - new_submission: Submission = Submission(student=student, group=group, student_id=student_id, + new_submission: Submission = Submission(student_id=student_id, group_id=group_id, message=message, state=state, date_time=date_time) db.session.add(new_submission) db.session.commit()