|
|
@ -1,4 +1,7 @@
|
|
|
|
from base64 import urlsafe_b64decode
|
|
|
|
from base64 import urlsafe_b64decode
|
|
|
|
|
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
|
|
|
|
from django.db.models import Count
|
|
|
|
|
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.shortcuts import render, get_object_or_404
|
|
|
|
from django.shortcuts import render, get_object_or_404
|
|
|
|
from shiftregister.fallback.models import TeamMember
|
|
|
|
from shiftregister.fallback.models import TeamMember
|
|
|
|
|
|
|
|
|
|
|
@ -26,3 +29,18 @@ def my_fallback_shifts(request, team_member_id):
|
|
|
|
"is_draw": is_draw,
|
|
|
|
"is_draw": is_draw,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return render(request, "my_fallback_shifts.html", context)
|
|
|
|
return render(request, "my_fallback_shifts.html", context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@login_required
|
|
|
|
|
|
|
|
def team_members(request):
|
|
|
|
|
|
|
|
response = HttpResponse(
|
|
|
|
|
|
|
|
"\n".join(
|
|
|
|
|
|
|
|
f"{member.name} {member.url()}"
|
|
|
|
|
|
|
|
for member in TeamMember.objects.annotate(
|
|
|
|
|
|
|
|
shift_count=Count("fallback_shifts")
|
|
|
|
|
|
|
|
).filter(fallback_shifts__gt=0)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
response.headers["Content-Type"] = "text/plain; charset=utf-8"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return response
|
|
|
|