Feat: add delete_student
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user