From e9078af5f6e2fbc445cc5c19737d7214cf1a3098 Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Tue, 22 Oct 2024 13:33:39 -0400 Subject: [PATCH] Do not filter leases by offer if no offer_uuid is specified --- esi_leap/api/controllers/v1/lease.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esi_leap/api/controllers/v1/lease.py b/esi_leap/api/controllers/v1/lease.py index 1898396b..5ea29c29 100644 --- a/esi_leap/api/controllers/v1/lease.py +++ b/esi_leap/api/controllers/v1/lease.py @@ -291,7 +291,6 @@ def _lease_get_all_authorize_filters( filters = { "status": status, - "offer_uuid": offer_uuid, "start_time": start_time, "end_time": end_time, "resource_type": resource_type, @@ -299,6 +298,9 @@ def _lease_get_all_authorize_filters( "time_filter_type": constants.WITHIN_TIME_FILTER, } + if offer_uuid is not None: + filters["offer_uuid"] = offer_uuid + if view == "all": utils.policy_authorize("esi_leap:lease:lease_admin", cdict, cdict) filters["owner_id"] = owner_id