Order payment: Auto-select payment method if there is only one

This commit is contained in:
Raphael Michel
2023-02-14 14:04:20 +01:00
parent 1399f97e1e
commit e33fbaf9c0

View File

@@ -698,6 +698,8 @@ class OrderPayChangeMethod(EventViewMixin, OrderDetailMixin, TemplateView):
ctx['order'] = self.order
ctx['providers'] = self.provider_forms
ctx['show_fees'] = any(p['fee_diff'] for p in self.provider_forms)
if len(self.provider_forms) == 1:
ctx['selected'] = self.provider_forms[0]['provider'].identifier
return ctx
def get_confirm_url(self, payment):