Skip to content

Commit b6f3c0e

Browse files
committed
Rename do_not_include_history to exclude_history
1 parent 0de0d0f commit b6f3c0e

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

debug_toolbar/panels/history/forms.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ class HistoryStoreForm(forms.Form):
99
"""
1010

1111
store_id = forms.CharField(widget=forms.HiddenInput())
12-
do_not_include_history = forms.BooleanField(
13-
widget=forms.HiddenInput(), required=False
14-
)
12+
exclude_history = forms.BooleanField(widget=forms.HiddenInput(), required=False)

debug_toolbar/panels/history/panel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def content(self):
9292
stores[id] = {
9393
"toolbar": toolbar,
9494
"form": HistoryStoreForm(
95-
initial={"store_id": id, "do_not_include_history": True}
95+
initial={"store_id": id, "exclude_history": True}
9696
),
9797
}
9898

@@ -104,7 +104,7 @@ def content(self):
104104
"refresh_form": HistoryStoreForm(
105105
initial={
106106
"store_id": self.toolbar.store_id,
107-
"do_not_include_history": True,
107+
"exclude_history": True,
108108
}
109109
),
110110
},

debug_toolbar/panels/history/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def history_sidebar(request):
1414
if form.is_valid():
1515
store_id = form.cleaned_data["store_id"]
1616
toolbar = DebugToolbar.fetch(store_id)
17-
do_not_include_history = form.cleaned_data["do_not_include_history"]
17+
exclude_history = form.cleaned_data["exclude_history"]
1818
context = {}
1919
if toolbar is None:
2020
# When the store_id has been popped already due to
2121
# RESULTS_CACHE_SIZE
2222
return JsonResponse(context)
2323
for panel in toolbar.panels:
24-
if do_not_include_history and not panel.is_historical:
24+
if exclude_history and not panel.is_historical:
2525
continue
2626
panel_context = {"panel": panel}
2727
context[panel.panel_id] = {
@@ -57,7 +57,7 @@ def history_refresh(request):
5757
"form": HistoryStoreForm(
5858
initial={
5959
"store_id": id,
60-
"do_not_include_history": True,
60+
"exclude_history": True,
6161
}
6262
),
6363
},

tests/panels/test_history.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_history_panel_integration_content(self):
9393
toolbar = list(DebugToolbar._store.values())[0]
9494
content = toolbar.get_panel_by_id("HistoryPanel").content
9595
self.assertIn("bar", content)
96-
self.assertIn('name="do_not_include_history" value="True"', content)
96+
self.assertIn('name="exclude_history" value="True"', content)
9797

9898
def test_history_sidebar_invalid(self):
9999
response = self.client.get(reverse("djdt:history_sidebar"))
@@ -103,7 +103,7 @@ def test_history_sidebar(self):
103103
"""Validate the history sidebar view."""
104104
self.client.get("/json_view/")
105105
store_id = list(DebugToolbar._store)[0]
106-
data = {"store_id": store_id, "do_not_include_history": True}
106+
data = {"store_id": store_id, "exclude_history": True}
107107
response = self.client.get(reverse("djdt:history_sidebar"), data=data)
108108
self.assertEqual(response.status_code, 200)
109109
self.assertEqual(
@@ -133,7 +133,7 @@ def test_history_sidebar_expired_store_id(self):
133133
"""Validate the history sidebar view."""
134134
self.client.get("/json_view/")
135135
store_id = list(DebugToolbar._store)[0]
136-
data = {"store_id": store_id, "do_not_include_history": True}
136+
data = {"store_id": store_id, "exclude_history": True}
137137
response = self.client.get(reverse("djdt:history_sidebar"), data=data)
138138
self.assertEqual(response.status_code, 200)
139139
self.assertEqual(
@@ -143,14 +143,14 @@ def test_history_sidebar_expired_store_id(self):
143143
self.client.get("/json_view/")
144144

145145
# Querying old store_id should return in empty response
146-
data = {"store_id": store_id, "do_not_include_history": True}
146+
data = {"store_id": store_id, "exclude_history": True}
147147
response = self.client.get(reverse("djdt:history_sidebar"), data=data)
148148
self.assertEqual(response.status_code, 200)
149149
self.assertEqual(response.json(), {})
150150

151151
# Querying with latest store_id
152152
latest_store_id = list(DebugToolbar._store)[0]
153-
data = {"store_id": latest_store_id, "do_not_include_history": True}
153+
data = {"store_id": latest_store_id, "exclude_history": True}
154154
response = self.client.get(reverse("djdt:history_sidebar"), data=data)
155155
self.assertEqual(response.status_code, 200)
156156
self.assertEqual(

0 commit comments

Comments
 (0)