diff --git a/src/howitz/endpoints.py b/src/howitz/endpoints.py index 4d239c22..9ef139ee 100644 --- a/src/howitz/endpoints.py +++ b/src/howitz/endpoints.py @@ -485,9 +485,7 @@ def unselect_event(i): except ValueError: pass - selected_events_types = set(session.get("selected_events", {}).values()) - selected_events_types.discard('portstate') - show_clear_flapping = not len(selected_events_types) > 0 + show_clear_flapping = all(event == 'portstate' for event in session.get("selected_events", dict(k='v')).values()) return render_template('/responses/toggle-select.html', id=i, is_checked=False, is_menu=len(session["selected_events"]) > 0, event_type=event_type, @@ -504,9 +502,7 @@ def select_event(i): except ValueError: pass - selected_events_types = set(session.get("selected_events", {}).values()) - selected_events_types.discard('portstate') - show_clear_flapping = not len(selected_events_types) > 0 + show_clear_flapping = all(event == 'portstate' for event in session.get("selected_events", dict(k='v')).values()) return render_template('/responses/toggle-select.html', id=i, is_checked=True, is_menu=len(session["selected_events"]) > 0, event_type=event_type,