Skip to content

Commit

Permalink
* Ok this really fixes the issue where the project page was showing i…
Browse files Browse the repository at this point in the history
…nactive documents.
  • Loading branch information
bgroff committed Nov 8, 2018
1 parent d1de802 commit f1cf2f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions django_kala/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __str__(self):

def get_documents(self, user):
if user.is_superuser:
return self.document_set.filter(project=self)
return self.document_set.filter(
return self.document_set.active().filter(project=self)
return self.document_set.active().filter(
project=self,
id__in=user.get_documents().values_list('id', flat=True)
)
Expand Down
2 changes: 1 addition & 1 deletion django_kala/projects/views/projects/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_context_data(self, **kwargs):
for document in self.documents:
for version in document.documentversion_set.all():
version_ids.append(str(version.uuid))
versions = DocumentVersion.objects.active().filter(uuid__in=version_ids).order_by('user_id')
versions = DocumentVersion.objects.filter(uuid__in=version_ids).order_by('user_id')

sort_order = self.request.GET.get('sort', None)
if sort_order:
Expand Down

0 comments on commit f1cf2f9

Please sign in to comment.