From 0c9471090ba01b9b43778de18de97d6cd8c170f7 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Mon, 18 Dec 2023 09:42:53 +0000 Subject: [PATCH] feedback --- codeforlife/user/views/user.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codeforlife/user/views/user.py b/codeforlife/user/views/user.py index ecfae8d..000b32b 100644 --- a/codeforlife/user/views/user.py +++ b/codeforlife/user/views/user.py @@ -21,14 +21,14 @@ def get_queryset(self): if not isinstance(user, User): return User.objects.none() - if user.student: + if user.student is not None: return User.objects.filter(student__klass_id=user.student.klass_id) - if user.teacher: + if user.teacher is not None: teachers = User.objects.none() students = User.objects.none() - if user.teacher.school_id: + if user.teacher.school_id is not None: teachers = User.objects.filter( teacher__school_id=user.teacher.school_id )