Commit aa03f107 authored by Rafael Monnerat's avatar Rafael Monnerat 👻 Committed by Romain Courteaud

slapos_panel: Fixup if subscription request is a temp object

  If you access the listbox before the subscription request is indexed the link is broken on the listbox.

  patch provided by: Romain Courteaud.
parent d7e310a5
...@@ -50,6 +50,16 @@ if outstanting_total_price > 0: ...@@ -50,6 +50,16 @@ if outstanting_total_price > 0:
if not context.Base_isExternalPaymentConfigured(currency_uid): if not context.Base_isExternalPaymentConfigured(currency_uid):
raise ValueError("External Payment support is not configured") raise ValueError("External Payment support is not configured")
if len(outstanding_amount_list) == 0:
# return payment_list
payment_list.append(context.asContext(
reference="Subscriptions pre-payment",
# Format by hand is not a good idea probably
stop_date=DateTime().strftime('%d/%m/%Y'),
resource_uid=currency_uid,
total_price=price,
))
else:
payment_list.append(outstanding_amount_list[0].asContext( payment_list.append(outstanding_amount_list[0].asContext(
reference="Subscriptions pre-payment", reference="Subscriptions pre-payment",
# Format by hand is not a good idea probably # Format by hand is not a good idea probably
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment