From e589cedb49185581c603bd23eac841278a968c8b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Sep 2022 11:42:50 +0200 Subject: [PATCH 1/2] fix it --- ereuse_devicehub/inventory/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 47681ff5..b70b7cc4 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -654,6 +654,8 @@ class NewActionView(View): if lot_id: return url_for('inventory.lotdevicelist', lot_id=lot_id) + if url_for('inventory.alldevicelist') in request.referrer: + return url_for('inventory.alldevicelist') return url_for('inventory.devicelist') From 59d835572840f8b00b9ee3bf2d3979c94a099846 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 27 Sep 2022 10:05:49 +0200 Subject: [PATCH 2/2] fix tests --- ereuse_devicehub/inventory/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index b70b7cc4..684be46f 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -654,7 +654,7 @@ class NewActionView(View): if lot_id: return url_for('inventory.lotdevicelist', lot_id=lot_id) - if url_for('inventory.alldevicelist') in request.referrer: + if url_for('inventory.alldevicelist') in (request.referrer or ''): return url_for('inventory.alldevicelist') return url_for('inventory.devicelist')