Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various #2495

Merged
merged 4 commits into from
Nov 2, 2024
Merged

Various #2495

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading