{% for slot in slots %}
<form class="booking_form" method="POST">
- <span class="booking_date">{{slot.day}} de {{slot.start_hour|date:"H\hi"}}}} à {{slot.end_hour|date:"H\hi"}}}}</span>
+ <span class="booking_date">{{slot.day}} de {{slot.start_hour|date:"H\hi"}} à {{slot.end_hour|date:"H\hi"}}</span>
{% csrf_token %}
<input type="hidden" name="slot_id" value="{{slot.id}}" />
<input type="submit" value="Sélectionner" />
def check_rights(self, user, webclass):
if not user.is_authenticated():
return HttpResponseRedirect(reverse('teleforma-login'))
- student = user.student.all().count()
+ student = user.student.all()[:1]
if not student:
return HttpResponse('Unauthorized', status=401)
+ student = student[0]
# check period
period_id = webclass.period.id
periods = [ p for p in get_periods(user) if int(p.id) == period_id ]
if not slot.participant_slot_available:
return u"Ce créneau n'est plus disponible."
- # # Check we don't have another appointment on this period
+ # Check we don't have another appointment on this period
+ webclass = slot.webclass
if webclass.get_slot(user):
return u"Vous êtes déjà inscrit."
if authorized:
return redirect(webclass_slot.get_join_webclass_url(request, user))
else:
- return HttpResponse('Unauthorized', status=401)
\ No newline at end of file
+ return HttpResponse('Unauthorized', status=401)