allow user to remove all views from dashboard
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 @@
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()