Skip to content

Commit

Permalink
Refactor extra_shifts query in edit_page view
Browse files Browse the repository at this point in the history
  • Loading branch information
Tubo committed Dec 28, 2023
1 parent 4d710e4 commit ba90e19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion radscheduler/core/views/extra_duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def interest(request, interest_id):
@staff_member_required
def edit_page(request):
extra_shifts = (
Shift.objects.filter(extra_duty=True, registrar=None).order_by("date").select_related("registrar__user")
Shift.objects.filter(extra_duty=True, registrar=None)
.order_by("date")
.select_related("registrar__user")
.prefetch_related("interests", "interests__registrar__user")
)

return render(
Expand Down

0 comments on commit ba90e19

Please sign in to comment.