Merged in [10973] from rjsparks@nostrum.com:

Show the drafts from all of a groups sessions on the materials page. Fixes #1933.
 - Legacy-Id: 10976
Note: SVN reference [10973] has been migrated to Git commit 71166df5a2
This commit is contained in:
Henrik Levkowetz 2016-03-24 17:57:46 +00:00
parent a1ae66dbcd
commit 0bcc7f0f3f
2 changed files with 7 additions and 1 deletions

View file

@ -958,6 +958,12 @@ class Session(models.Model):
def drafts(self):
return list(self.materials.filter(type='draft'))
def all_meeting_drafts(self):
drafts = []
for session in self.meeting.session_set.filter(group=self.group):
drafts.extend(session.drafts())
return drafts
def can_manage_materials(self, user):
return can_manage_materials(user,self.group)

View file

@ -49,7 +49,7 @@
{% endwith %}
</td>
<td>
{% with session.drafts as drafts %}
{% with session.all_meeting_drafts as drafts %}
{% for draft in drafts %}
<a href="{% url "doc_view" name=draft.canonical_name %}">{{ draft.canonical_name }}</a><br>
{% empty %}