From 124133bb600d482f43df02a6274b83318ebb40a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Sacawa?=
Date: Thu, 5 Aug 2021 13:23:44 -0400
Subject: [PATCH 1/3] Add: response status to HistoryPanel
---
debug_toolbar/panels/history/panel.py | 1 +
debug_toolbar/templates/debug_toolbar/panels/history.html | 1 +
debug_toolbar/templates/debug_toolbar/panels/history_tr.html | 3 +++
3 files changed, 5 insertions(+)
diff --git a/debug_toolbar/panels/history/panel.py b/debug_toolbar/panels/history/panel.py
index 0cc352e8b..541c59136 100644
--- a/debug_toolbar/panels/history/panel.py
+++ b/debug_toolbar/panels/history/panel.py
@@ -68,6 +68,7 @@ def generate_stats(self, request, response):
{
"request_url": request.get_full_path(),
"request_method": request.method,
+ "status_code": response.status_code,
"data": data,
"time": timezone.now(),
}
diff --git a/debug_toolbar/templates/debug_toolbar/panels/history.html b/debug_toolbar/templates/debug_toolbar/panels/history.html
index f5e967a17..84c6cb5bd 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/history.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/history.html
@@ -10,6 +10,7 @@
{% trans "Method" %} |
{% trans "Path" %} |
{% trans "Request Variables" %} |
+ {% trans "Status" %} |
{% trans "Action" %} |
diff --git a/debug_toolbar/templates/debug_toolbar/panels/history_tr.html b/debug_toolbar/templates/debug_toolbar/panels/history_tr.html
index 9ce984396..31793472a 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/history_tr.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/history_tr.html
@@ -38,6 +38,9 @@
+
+ {{ store_context.toolbar.stats.HistoryPanel.status_code|escape }}
+ |
|