From 54740accf0d68e7292b7ebd09350bbb545c8f7f8 Mon Sep 17 00:00:00 2001 From: miboelae Date: Thu, 23 May 2024 14:08:29 +0200 Subject: [PATCH] linter --- backend/src/subject/models.py | 2 +- backend/src/user/service.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/subject/models.py b/backend/src/subject/models.py index a59d0f29..9f8abc22 100644 --- a/backend/src/subject/models.py +++ b/backend/src/subject/models.py @@ -8,7 +8,7 @@ "student_subject", Base.metadata, Column("uid", ForeignKey("website_user.uid", ondelete="CASCADE"), primary_key=True), - Column("subject_id", ForeignKey("subject.id" , ondelete="CASCADE"), primary_key=True), + Column("subject_id", ForeignKey("subject.id", ondelete="CASCADE"), primary_key=True), ) InstructorSubject = Table( diff --git a/backend/src/user/service.py b/backend/src/user/service.py index 5c0c3399..bd88a61e 100644 --- a/backend/src/user/service.py +++ b/backend/src/user/service.py @@ -42,11 +42,11 @@ async def set_teacher(db: AsyncSession, user_id: str, value: bool): async def delete_user(db: AsyncSession, user_id: str): user = await get_by_id(db, user_id) if user: - await db.execute(delete(StudentSubject).where(StudentSubject.c.uid == user_id)) + await db.execute(delete(StudentSubject).where(StudentSubject.c.uid == user_id)) await db.execute(delete(InstructorProject).where(InstructorProject.c.uid == user_id)) await db.execute(delete(StudentGroup).where(StudentGroup.c.uid == user_id)) await db.flush() - + await db.delete(user) await db.commit()