diff --git a/physionet-django/events/models.py b/physionet-django/events/models.py index 1b904b950e..dcc09cda27 100644 --- a/physionet-django/events/models.py +++ b/physionet-django/events/models.py @@ -59,6 +59,12 @@ def get_cohosts(self): """ return self.participants.filter(is_cohost=True) + def has_ended(self): + """ + Returns true if the event has ended. + """ + return self.end_date < timezone.now().date() + class EventParticipant(models.Model): """ diff --git a/physionet-django/events/templates/events/event_entries.html b/physionet-django/events/templates/events/event_entries.html index c2f8c5370c..ed998096bc 100644 --- a/physionet-django/events/templates/events/event_entries.html +++ b/physionet-django/events/templates/events/event_entries.html @@ -17,21 +17,23 @@ {{ participant.user.email }} {{ participant.user.is_credentialed }} - {% if participant.is_cohost %} -
- {% csrf_token %} - - - -
- {% else %} -
- {% csrf_token %} - - - -
- {% endif %} + {% if not event.has_ended %} + {% if participant.is_cohost %} +
+ {% csrf_token %} + + + +
+ {% else %} +
+ {% csrf_token %} + + + +
+ {% endif %} + {% endif %} {% endfor %}