Skip to content

Commit

Permalink
Merge branch 'master' of gitlab.com:foss4g-2021/software/pretix-merca…
Browse files Browse the repository at this point in the history
…dopago
  • Loading branch information
manureta committed Jul 28, 2020
2 parents d5d34b7 + fa2b286 commit c685766
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pretix_mercadopago/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ def payment_is_valid_session(self, request):
"""

def payment_form_render(self, request) -> str:
template = get_template('pretix_mercadopago/checkout_payment_form.html')
try:
# TODO weird error that doesn't include templates on our path folder
template = get_template('../../pretix_mercadopago/templates/pretix_mercadopago/checkout_payment_form.html')
except Exception as e:
template = get_template('pretixplugins/paypal/checkout_payment_form.html')

ctx = {'request': request, 'event': self.event, 'settings': self.settings}
return template.render(ctx)

Expand Down Expand Up @@ -281,7 +286,12 @@ def checkout_confirm_render(self, request) -> str:
Returns the HTML that should be displayed when the user selected this provider
on the 'confirm order' page.
"""
template = get_template('pretix_mercadopago/checkout_payment_confirm.html')

try:
# TODO weird error that doesn't include templates on our path folder
template = get_template('../../pretix_mercadopago/templates/pretix_mercadopago/checkout_payment_confirm.html')
except Exception as e:
template = get_template('pretixplugins/paypal/checkout_payment_confirm.html')
ctx = {'request': request, 'event': self.event, 'settings': self.settings}
return template.render(ctx)

Expand All @@ -292,7 +302,12 @@ def payment_pending_render(self, request, payment) -> str:
retry = False
except KeyError:
pass
template = get_template('pretix_mercadopago/pending.html')
try:
# TODO weird error that doesn't include templates on our path folder
template = get_template('../../pretix_mercadopago/templates/pretix_mercadopago/pending.html')
except Exception as e:
template = get_template('pretixplugins/paypal/pending.html')

ctx = {'request': request, 'event': self.event, 'settings': self.settings,
'retry': retry, 'order': payment.order}
return template.render(ctx)
Expand Down

0 comments on commit c685766

Please sign in to comment.