From e39241a9e94f676295523a4b6cb05ad558ebeb3a Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 11 May 2023 18:36:20 +0200 Subject: [PATCH] Fix: `get_payments` crud default `Filter` values. (#1703) * get_payments: deafult values for filter * lololololoolol --- lnbits/core/crud.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index b2c0f7a8..9dd0be5b 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -426,11 +426,10 @@ async def get_payments( Filters payments to be returned by complete | pending | outgoing | incoming. """ - if not filters: - filters = Filters() + filters = filters or Filters() - filters.sortby = "time" or filters.sortby - filters.direction = "desc" or filters.direction + filters.sortby = filters.sortby or "time" + filters.direction = filters.direction or "desc" filters.limit = limit or filters.limit filters.offset = offset or filters.offset