Skip to content

Commit

Permalink
Merge pull request #2495 from liberapay/various
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Nov 2, 2024
2 parents 6554764 + d9eab44 commit 572d47d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Liberapay.forms.jsSubmit = function() {
// Determine the submission mode
var form_on_success = form.getAttribute('data-on-success');
var button, button_on_success;
if (e.submitter.tagName == 'BUTTON') {
if (e.submitter && e.submitter.tagName == 'BUTTON') {
button = e.submitter;
button_on_success = button.getAttribute('data-on-success');
}
Expand Down
2 changes: 1 addition & 1 deletion liberapay/elsewhere/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Twitter(PlatformOAuth1):
# Platform attributes
name = 'twitter'
display_name = 'Twitter'
account_url = 'https://twitter.com/{user_name}'
account_url = 'https://x.com/{user_name}'

# Auth attributes
auth_url = 'https://api.twitter.com'
Expand Down
3 changes: 2 additions & 1 deletion www/%username/giving/pay/paypal/%payin_id.spt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if request.method == 'POST':
JOIN participants p ON p.id = t.tippee
WHERE t.tipper = %s
AND t.id IN %s
AND t.renewal_mode > 0
AND p.payment_providers & %s > 0
ORDER BY t.id
""", (payer.id, set(body.parse_list('tips', int)), PAYPAL_BIT))
Expand Down Expand Up @@ -106,7 +107,7 @@ tippees = request.qs.parse_list('beneficiary', int, default=None)
if tippees:
tips = [
tip for tip in payer.get_tips_to(tippees)
if tip.tippee_p.payment_providers & PAYPAL_BIT > 0
if tip.renewal_mode > 0 and tip.tippee_p.payment_providers & PAYPAL_BIT > 0
]
if len(set(tip.amount.currency for tip in tips)) != 1:
raise response.invalid_input(tippees, 'beneficiary', 'querystring')
Expand Down
3 changes: 2 additions & 1 deletion www/%username/giving/pay/stripe/%payin_id.spt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if request.method == 'POST':
JOIN participants p ON p.id = t.tippee
WHERE t.tipper = %s
AND t.id IN %s
AND t.renewal_mode > 0
AND p.payment_providers & %s > 0
ORDER BY t.id
""", (payer.id, set(body.parse_list('tips', int)), STRIPE_BIT))
Expand Down Expand Up @@ -198,7 +199,7 @@ tippees = request.qs.parse_list('beneficiary', int, default=None)
if tippees:
tips = [
tip for tip in payer.get_tips_to(tippees)
if tip.tippee_p.payment_providers & STRIPE_BIT > 0
if tip.renewal_mode > 0 and tip.tippee_p.payment_providers & STRIPE_BIT > 0
]
if len(set(tip.amount.currency for tip in tips)) != 1:
raise response.invalid_input(tippees, 'beneficiary', 'querystring')
Expand Down
4 changes: 2 additions & 2 deletions www/%username/routes/index.spt
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ title = _("Payment Instruments")
name="set_as_default_for" value="{{ route.id }}:"
title="{{ _(
'Stop using this instrument by default for payments in {currency}.',
currency=Currency(last_payin.amount.currency)
currency=Currency(route.is_default_for)
) }}">{{ _(
"Unset as default for {currency}", currency=last_payin.amount.currency
"Unset as default for {currency}", currency=route.is_default_for
) }}</button>
% elif route.network != 'stripe-card' and last_payin and participant.donates_in_multiple_currencies
<button class="btn btn-primary btn-xs"
Expand Down

0 comments on commit 572d47d

Please sign in to comment.