<div class="desk_center">
- {% if webclass and not webclass_slot %}
+ {% if webclass and not webclass_slot and webclass_not_over %}
<div class="block important">
<p>
<strong>Vous n'êtes pas inscrit à la webclass de cette matière. </strong><a
continue
if not student.platform_only and not webclass.allow_presentiel:
continue
+ if not webclass.is_not_over():
+ continue
slot = webclass.get_slot(user)
if slot and slot.status in ('almost', 'ingoing'):
slots.append(slot)
webclass_slot = webclass.get_slot(self.request.user)
context['webclass'] = webclass
context['webclass_slot'] = webclass_slot
+ context['webclass_not_over'] = webclass.is_not_over()
try:
context['webclass_records'] = WebclassRecord.get_records(
except WebclassSlot.DoesNotExist:
return None
+ def is_not_over(self):
+ """
+ Check if the webclass is not over yet
+ """
+ if self.end_date and self.end_date < datetime.date.today():
+ return False
+ return True
+
class SlotPublishedManager(models.Manager):
def get_query_set(self):