enrol?ajax=json renvoie un JSON pour le calendrier dynamique
This commit is contained in:
parent
b1c0dd857d
commit
511c3096f7
1 changed files with 6 additions and 0 deletions
|
@ -52,6 +52,12 @@ class EnrolActivityView(LoginRequiredMixin, View):
|
|||
else:
|
||||
success = False
|
||||
if "ajax" in request.GET:
|
||||
if request.GET["ajax"] == "json":
|
||||
enrols = activity.staff
|
||||
return JsonResponse({
|
||||
"enrolled": enrols.filter(id=request.user.id).exists(),
|
||||
"number": enrols.count(),
|
||||
})
|
||||
return render(request, "event/activity_summary.html",
|
||||
{"activity": activity})
|
||||
return HttpResponseRedirect(reverse("event:activity", kwargs={"pk":pk}))
|
||||
|
|
Loading…
Reference in a new issue