Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
aanpassen create functies
Browse files Browse the repository at this point in the history
  • Loading branch information
ALBERICLOOS committed Feb 27, 2024
1 parent d8389ea commit 4f68cea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/db/implementation/SqlGroupDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion backend/db/implementation/SqlProjectDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion backend/db/implementation/SqlSubmissionDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4f68cea

Please sign in to comment.