Commit d8b785d3 authored by matejcik's avatar matejcik

fix behavior of subscriptions when only one project is present

parent 6b6cc1a4
...@@ -71,8 +71,9 @@ def home(request): ...@@ -71,8 +71,9 @@ def home(request):
wb_messages = WhiteboardMessage.objects.all() wb_messages = WhiteboardMessage.objects.all()
projects = Project.objects.all_acl(request.user) projects = Project.objects.all_acl(request.user)
subproject_list = None
if projects.count() == 1: if projects.count() == 1:
projects = SubProject.objects.filter( subproject_list = SubProject.objects.filter(
project=projects[0] project=projects[0]
).select_related() ).select_related()
...@@ -132,7 +133,7 @@ def home(request): ...@@ -132,7 +133,7 @@ def home(request):
request, request,
'index.html', 'index.html',
{ {
'projects': projects, 'projects': subproject_list or projects,
'top_translations': top_translations.select_related('user'), 'top_translations': top_translations.select_related('user'),
'top_suggestions': top_suggestions.select_related('user'), 'top_suggestions': top_suggestions.select_related('user'),
'last_changes': last_changes, 'last_changes': last_changes,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment