lingo: simplify extraction of subject for single payment (#47477)

This commit is contained in:
Benjamin Dauvergne 2020-10-23 16:56:26 +02:00
parent 1c22405e8b
commit e1887d0384
1 changed files with 2 additions and 4 deletions

View File

@ -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: