Skip to content

Commit 572d47d

Browse files
authored
Merge pull request #2495 from liberapay/various
2 parents 6554764 + d9eab44 commit 572d47d

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

js/forms.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Liberapay.forms.jsSubmit = function() {
6565
// Determine the submission mode
6666
var form_on_success = form.getAttribute('data-on-success');
6767
var button, button_on_success;
68-
if (e.submitter.tagName == 'BUTTON') {
68+
if (e.submitter && e.submitter.tagName == 'BUTTON') {
6969
button = e.submitter;
7070
button_on_success = button.getAttribute('data-on-success');
7171
}

liberapay/elsewhere/twitter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Twitter(PlatformOAuth1):
88
# Platform attributes
99
name = 'twitter'
1010
display_name = 'Twitter'
11-
account_url = 'https://twitter.com/{user_name}'
11+
account_url = 'https://x.com/{user_name}'
1212

1313
# Auth attributes
1414
auth_url = 'https://api.twitter.com'

www/%username/giving/pay/paypal/%payin_id.spt

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if request.method == 'POST':
4040
JOIN participants p ON p.id = t.tippee
4141
WHERE t.tipper = %s
4242
AND t.id IN %s
43+
AND t.renewal_mode > 0
4344
AND p.payment_providers & %s > 0
4445
ORDER BY t.id
4546
""", (payer.id, set(body.parse_list('tips', int)), PAYPAL_BIT))
@@ -106,7 +107,7 @@ tippees = request.qs.parse_list('beneficiary', int, default=None)
106107
if tippees:
107108
tips = [
108109
tip for tip in payer.get_tips_to(tippees)
109-
if tip.tippee_p.payment_providers & PAYPAL_BIT > 0
110+
if tip.renewal_mode > 0 and tip.tippee_p.payment_providers & PAYPAL_BIT > 0
110111
]
111112
if len(set(tip.amount.currency for tip in tips)) != 1:
112113
raise response.invalid_input(tippees, 'beneficiary', 'querystring')

www/%username/giving/pay/stripe/%payin_id.spt

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ if request.method == 'POST':
5050
JOIN participants p ON p.id = t.tippee
5151
WHERE t.tipper = %s
5252
AND t.id IN %s
53+
AND t.renewal_mode > 0
5354
AND p.payment_providers & %s > 0
5455
ORDER BY t.id
5556
""", (payer.id, set(body.parse_list('tips', int)), STRIPE_BIT))
@@ -198,7 +199,7 @@ tippees = request.qs.parse_list('beneficiary', int, default=None)
198199
if tippees:
199200
tips = [
200201
tip for tip in payer.get_tips_to(tippees)
201-
if tip.tippee_p.payment_providers & STRIPE_BIT > 0
202+
if tip.renewal_mode > 0 and tip.tippee_p.payment_providers & STRIPE_BIT > 0
202203
]
203204
if len(set(tip.amount.currency for tip in tips)) != 1:
204205
raise response.invalid_input(tippees, 'beneficiary', 'querystring')

www/%username/routes/index.spt

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ title = _("Payment Instruments")
191191
name="set_as_default_for" value="{{ route.id }}:"
192192
title="{{ _(
193193
'Stop using this instrument by default for payments in {currency}.',
194-
currency=Currency(last_payin.amount.currency)
194+
currency=Currency(route.is_default_for)
195195
) }}">{{ _(
196-
"Unset as default for {currency}", currency=last_payin.amount.currency
196+
"Unset as default for {currency}", currency=route.is_default_for
197197
) }}</button>
198198
% elif route.network != 'stripe-card' and last_payin and participant.donates_in_multiple_currencies
199199
<button class="btn btn-primary btn-xs"

0 commit comments

Comments
 (0)