Skip to content

Commit

Permalink
fix: prefetch student and teacher profile
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Feb 20, 2024
1 parent c5d4ff9 commit 68735e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codeforlife/user/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def get_queryset(self):
super()
.get_queryset()
.filter(new_teacher__isnull=False, new_student__isnull=True)
.prefetch_related("new_teacher")
)


Expand Down Expand Up @@ -261,6 +262,7 @@ def get_queryset(self):
# TODO: remove in new model
new_student__class_field__isnull=False,
)
.prefetch_related("new_student")
)


Expand Down

0 comments on commit 68735e4

Please sign in to comment.