From 498d2ec92ff66bc5ac5c608a5f5e39891a937974 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 10 Mar 2023 21:56:17 +0100 Subject: [PATCH] fix test --- ereuse_devicehub/inventory/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 91ea99cc..5ebabaa5 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -1091,10 +1091,10 @@ class ExportsView(View): return my_data, customer_details def get_customer_details_from_request(self): - if len(request.referrer.split('/lot/')) < 2: - return - try: + if len(request.referrer.split('/lot/')) < 2: + return + lot_id = request.referrer.split('/lot/')[-1].split('/')[0] lot = Lot.query.filter_by(owner=g.user).filter_by(id=lot_id).first() return lot.transfer.customer_details