0001-lingo-remove-callback_url-on-backend-page-56650.patch
combo/apps/lingo/manager_views.py | ||
---|---|---|
78 | 78 |
form_class = PaymentBackendForm |
79 | 79 |
success_url = reverse_lazy('lingo-manager-paymentbackend-list') |
80 | 80 | |
81 |
def get_context_data(self, **kwargs): |
|
82 |
ctx = super().get_context_data(**kwargs) |
|
83 |
ctx['callback_url'] = self.request.build_absolute_uri(self.object.callback_url) |
|
84 |
return ctx |
|
85 | ||
86 | 81 | |
87 | 82 |
class PaymentBackendDeleteView(DeleteView): |
88 | 83 |
model = PaymentBackend |
combo/apps/lingo/templates/lingo/paymentbackend_form.html | ||
---|---|---|
11 | 11 | |
12 | 12 |
{% block content %} |
13 | 13 |
<form method="post" enctype="multipart/form-data"> |
14 |
{% if object.id and callback_url %} |
|
15 |
<p><label>{% trans "Callback URL:" %}</label> {{ callback_url }}</p> |
|
16 |
{% endif %} |
|
17 | 14 |
{% csrf_token %} |
18 | 15 |
{{ form.as_p }} |
19 | 16 |
<div class="buttons"> |
tests/test_lingo_manager.py | ||
---|---|---|
638 | 638 |
resp = app.get('/manage/lingo/paymentbackends/%s/edit' % payment_backend.pk, status=200) |
639 | 639 |
assert '/manage/lingo/paymentbackends/' in resp.text |
640 | 640 | |
641 |
# callback URL is shown |
|
642 |
assert ( |
|
643 |
'<p><label>Callback URL:</label> http://testserver/lingo/callback-payment-backend/%s/</p>' |
|
644 |
% payment_backend.slug |
|
645 |
in resp |
|
646 |
) |
|
647 | ||
648 | 641 |
# service cannot be changed |
649 | 642 |
assert 'disabled' in resp.form['service'].attrs |
650 | 643 | |
651 |
- |