summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-09-02 17:25:09 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 16:52:49 +0100
commitc9a05be1ffdabb454ee04a905bc6de6f7e3fcc47 (patch)
treee49f49157e44743740e319e1fde9fb264f38bf70 /bitbake
parent214ba674d057107688a281c542c21170657175e1 (diff)
downloadpoky-c9a05be1ffdabb454ee04a905bc6de6f7e3fcc47.tar.gz
bitbake: toaster: Only redirect to projects page if user has added projects
The landing page currently redirects the user if there are any projects in the db. Because we now always have at least one (the default one added by a migration), we always get the redirect. Change this so that when the user hits the landing page, we only redirect them to the projects page if there is at least one user-added project and there are no builds. [YOCTO #7932] (Bitbake rev: 316a70da93055b63eff7d40b7fd8bd07299074af) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index c583d9613a..6c73eb4c50 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -54,7 +54,11 @@ logger = logging.getLogger("toaster")
54# all new sessions should come through the landing page; 54# all new sessions should come through the landing page;
55# determine in which mode we are running in, and redirect appropriately 55# determine in which mode we are running in, and redirect appropriately
56def landing(request): 56def landing(request):
57 if Build.objects.count() == 0 and Project.objects.count() > 0: 57 # we only redirect to projects page if there is a user-generated project
58 user_projects = Project.objects.filter(is_default = False)
59 has_user_project = user_projects.count() > 0
60
61 if Build.objects.count() == 0 and has_user_project:
58 return redirect(reverse('all-projects'), permanent = False) 62 return redirect(reverse('all-projects'), permanent = False)
59 63
60 if Build.objects.all().count() > 0: 64 if Build.objects.all().count() > 0: