Don't show links to individual meeting stats pages when there's no content (meeting 71 and earlier currently has no attendance records).

- Legacy-Id: 14948
This commit is contained in:
Henrik Levkowetz 2018-03-26 23:05:43 +00:00
parent 176022f57b
commit 76404ceb4b
2 changed files with 22 additions and 6 deletions

View file

@ -171,6 +171,13 @@ class Meeting(models.Model):
def get_schedule_by_name(self, name):
return self.schedule_set.filter(name=name).first()
def get_number(self):
"Return integer meeting number for ietf meetings, rather than strings."
if self.number.isdigit():
return int(self.number)
else:
return None
@property
def sessions_that_can_meet(self):
qs = self.session_set.exclude(status__slug='notmeet').exclude(status__slug='disappr').exclude(status__slug='deleted').exclude(status__slug='apprw')

View file

@ -123,12 +123,21 @@
<tbody>
{% for meeting, url, count, country in table_data %}
<tr>
<td>{{ meeting.number }}</td>
<td>{{ meeting.date }} </td>
<td><a href="{{ url }}">{{ meeting.city }}</a></td>
<td>{{ country.name }}</td>
<td>{{ country.continent }}</td>
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
{% if meeting.get_number > 71 %}
<td><a href="{{ url }}">{{ meeting.number }}</a></td>
<td>{{ meeting.date }} </td>
<td><a href="{{ url }}">{{ meeting.city }}</a></td>
<td>{{ country.name }}</td>
<td>{{ country.continent }}</td>
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
{% else %}
<td>{{ meeting.number }}</td>
<td>{{ meeting.date }} </td>
<td>{{ meeting.city }}</td>
<td>{{ country.name }}</td>
<td>{{ country.continent }}</td>
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>