From 2870e27fe40b35fb7f57df4538321605d1ba39a5 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Mon, 19 May 2014 18:14:54 -0700 Subject: [PATCH] allow user to remove all views from dashboard --- planetstack/core/plus/views.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/planetstack/core/plus/views.py b/planetstack/core/plus/views.py index 142911b..11cc4f5 100644 --- a/planetstack/core/plus/views.py +++ b/planetstack/core/plus/views.py @@ -726,11 +726,10 @@ class DashboardCustomize(View): def post(self, request, *args, **kwargs): dashboards = request.POST.get("dashboards", None) if not dashboards: - return HttpResponse("no data") - - dashboards = [x.strip() for x in dashboards.split(",")] - - dashboards = [DashboardView.objects.get(name=x) for x in dashboards] + dashboards=[] + else: + dashboards = [x.strip() for x in dashboards.split(",")] + dashboards = [DashboardView.objects.get(name=x) for x in dashboards] request.user.dashboardViews.all().delete() -- 2.47.0