Feat: add delete_student

This commit is contained in:
2022-12-30 10:39:51 +01:00
parent 066990d109
commit 356db507eb
2 changed files with 56 additions and 4 deletions

View File

@@ -84,7 +84,6 @@ def update_student(
tribe_repo: AbstractRepository,
conn,
) -> Student:
try:
_tribe = tribe_repo.get(tribe)
except TribeRepositoryError:
@@ -103,3 +102,15 @@ def update_student(
conn.commit()
return student
def delete_student(
id: str,
student_repo: AbstractRepository,
conn,
) -> Student:
try:
student_repo.delete(id=id)
except StudentRepositoryError:
raise StudentDoesExist("The student with id {id} does not exists")
conn.commit()