diff --git a/horizon/tabs/views.py b/horizon/tabs/views.py index e959a267b3..92b3b6cf46 100644 --- a/horizon/tabs/views.py +++ b/horizon/tabs/views.py @@ -138,14 +138,16 @@ class TabbedTableView(tables.MultiTableMixin, TabView): def post(self, request, *args, **kwargs): # Direct POST to it's appropriate tab - targetslug = request.POST['action'].split('__')[0] - tabs = self.get_tabs(self.request, **self.kwargs).get_tabs() - matches = [tab for tab in tabs if tab.slug == targetslug] - if matches: - # Call POST on first match only. There shouldn't be a case where - # multiple tabs have the same slug and processing the request twice - # could lead to unpredictable behavior. - matches[0].post(request, *args, **kwargs) + # Note some table actions like filter do not have an 'action' + if 'action' in request.POST: + targetslug = request.POST['action'].split('__')[0] + tabs = self.get_tabs(self.request, **self.kwargs).get_tabs() + matches = [tab for tab in tabs if tab.slug == targetslug] + if matches: + # Call POST on first match only. There shouldn't be a case + # where multiple tabs have the same slug and processing the + # request twice could lead to unpredictable behavior. + matches[0].post(request, *args, **kwargs) # GET and POST handling are the same return self.get(request, *args, **kwargs)