reduce team shift view query count

pull/1/head
parent 4f4b5c3009
commit 7aa5da28fe

@ -93,7 +93,9 @@ def add_helper_shift(self):
@login_required
def shift_detail(request, pk):
shift = get_object_or_404(Shift, pk=pk)
shift = get_object_or_404(
Shift.with_reg_count().prefetch_related("shiftregistration_set__helper"), pk=pk
)
form = HelperShift()
if request.method == "POST":
form = HelperShift(request.POST)

Loading…
Cancel
Save