From cfa3d578b9ead486837c3e4c757bddba8f2b4d15 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 23 Oct 2020 16:56:26 +0200 Subject: [PATCH 3/7] lingo: simplify extraction of subject for single payment (#47506) --- combo/apps/lingo/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/combo/apps/lingo/views.py b/combo/apps/lingo/views.py index fba0490a..9b81fb53 100644 --- a/combo/apps/lingo/views.py +++ b/combo/apps/lingo/views.py @@ -414,10 +414,8 @@ class PayMixin(object): if capture_date: kwargs['capture_date'] = capture_date if regie.can_pay_only_one_basket_item: - if items and len(items) == 1: - kwargs['subject'] = items[0].subject - if remote_items and len(remote_items) == 1: - kwargs['subject'] = remote_items[0].subject + item = (items or remote_items)[0] + kwargs['subject'] = item.subject if regie.transaction_options: kwargs.update(regie.transaction_options) try: -- 2.28.0