diff --git a/liberapay/models/exchange_route.py b/liberapay/models/exchange_route.py index cd32a938d..a6a202acd 100644 --- a/liberapay/models/exchange_route.py +++ b/liberapay/models/exchange_route.py @@ -217,7 +217,7 @@ def attach_stripe_source(cls, participant, source, one_off): route.stripe_source = source return route - def invalidate(self, obj=None): + def invalidate(self): if self.network.startswith('stripe-'): if self.address.startswith('pm_'): try: diff --git a/liberapay/payin/common.py b/liberapay/payin/common.py index f727f26ac..7aa9cf339 100644 --- a/liberapay/payin/common.py +++ b/liberapay/payin/common.py @@ -137,12 +137,16 @@ def update_payin( """, (payin_id, status, error)) if status in ('pending', 'succeeded'): - cursor.run(""" + route = cursor.one(""" UPDATE exchange_routes SET status = 'consumed' WHERE id = %s - AND one_off IS TRUE + AND one_off + AND status = 'chargeable' + RETURNING exchange_routes """, (payin.route,)) + if route: + route.invalidate() # Lock to avoid concurrent updates cursor.run("SELECT * FROM participants WHERE id = %s FOR UPDATE", diff --git a/style/base/base.scss b/style/base/base.scss index 7bf4b8384..9d4cf5209 100644 --- a/style/base/base.scss +++ b/style/base/base.scss @@ -690,9 +690,6 @@ table.team { border-left: 2px solid #ddd; } } - tr:nth-child(2) > th:nth-child(4), td:nth-child(4) { - border-left: 1px dashed #ddd; - } td:first-child { min-width: 12em; } @@ -701,6 +698,9 @@ table.team { min-width: 8em; max-width: 11em; } + tr:last-child td { + border-top-width: 2px; + } input { text-align: inherit; } diff --git a/templates/macros/team-members.html b/templates/macros/team-members.html index e7f57fa72..c1cec082e 100644 --- a/templates/macros/team-members.html +++ b/templates/macros/team-members.html @@ -21,23 +21,16 @@ % endif - - - - - - - @@ -45,13 +38,16 @@ % for member in members.values() - % set nominal_take = member.nominal_take % set cell_cls = get_cls(member) if nominal_take != member.last_week else '' + % set title = ( + None if member.last_week == nominal_take else + _("Last week: {0}", ( + _("no take") if member.last_week is none else + _("auto") if member.last_week.amount == -1 else + member.last_week + )) + ) % if member.id == user.id - % elif nominal_take.amount == -1 - % else - + % endif % set fuzzy_take = member.actual_amount.fuzzy_sum(nominal_take.currency) {{ @@ -107,7 +103,6 @@ 'because it is not a legal entity.' ) }}" data-toggle="tooltip" data-placement="bottom">{{ _("Leftover") }} - % set fuzzy_leftover = members.leftover.fuzzy_sum(team.main_currency)
{{ _("Last Payday") }}
({{ locale.format_date(last_payday) if last_payday else _("n/a") }})
{{ _("Next Payday") }}
({{ locale.format_date(next_payday) }})
{{ _("Member") }} {{ _("Nominal Take") }}{{ _("Nominal Take") }} {{ _("Actual Take") }} {{ _("Advance") }}
{{ member.username }}{{ - _("n/a") if member.last_week is none else - _("auto") if member.last_week.amount == -1 else - locale.format_money(member.last_week) - }}
+ }}" placeholder="auto"{% if title %} title="{{ title }}"{% endif %} />
{{ _("auto") }}{{ locale.format_money(nominal_take) }}{{ + _("auto") if nominal_take.amount == -1 else locale.format_money(nominal_take) + }}{{ diff --git a/www/about/faq.spt b/www/about/faq.spt index b2e842ed4..a37556f7c 100644 --- a/www/about/faq.spt +++ b/www/about/faq.spt @@ -239,24 +239,16 @@ title = _("Frequently Asked Questions")
{{ _("Probably not, but it depends on the tax rules of your country.") }}
- {{ dt(_("What are wallets?"), 'wallets') }} + {{ dt(_("Is a Liberapay account a wallet?"), 'wallets') }}
{{ _( - "Liberapay used to hold the funds of donors in wallets, but we no longer do " - "that. Instead the full amount of a donation is immediately transferred to " - "the recipient." + "Not since mid-2018. Money sent by a donor immediately goes to the " + "recipient. Previously, funds were held in the donor's account and " + "disbursed little by little to the recipient every week. That system " + "was definitively abandoned due to its very significant drawbacks." ) }}
- {{ dt(_("What is “payday”?"), 'payday') }} - -

{{ _( - "Payday is a program ({0}this one{1}) that we run every Wednesday. It " - "executes donations and notifies donors and recipients.", - ''|safe, - ''|safe - ) }}

- % endblock diff --git a/www/about/teams.spt b/www/about/teams.spt index 733680b93..da2967736 100644 --- a/www/about/teams.spt +++ b/www/about/teams.spt @@ -138,9 +138,9 @@ title = _("Teams")

{{ _( "You can change your takes from {0}your teams dashboard{1}. It contains " - "tables that show the nominal takes of all members for the next and " - "previous payday, as well as an estimate of the actual amounts of money " - "they'll receive in the next payday.", + "tables that show the nominal takes of all members, as well as an estimate " + "of the actual amounts of money that will be deducted at the end of the " + "current weekly cycle.", ''|safe, ''|safe ) }}

@@ -184,7 +184,7 @@ title = _("Teams")

{{ _( "When “take throttling” is enabled for a team, its members can't raise their " "takes higher than a maximum computed on the basis of the nominal takes at " - "the time of the previous payday. This mechanism is meant to encourage " + "the end of the previous weekly cycle. This mechanism is meant to encourage " "inviting new contributors to join the team, by ensuring that they won't " "take a disproportionate share of the income in their first weeks." ) }}

@@ -193,16 +193,16 @@ title = _("Teams") "The limit works like this: you can always increase your take to {amount} if " "it was below that, you can double your take compared to the previous week, " "you can raise your take to claim the team's leftover income, and you can " - "bring your take up to the level of the median take in the previous payday. " - "Whichever of these possibilities results in the highest amount is your " - "maximum take for the week.", + "bring your take up to the level of the median take at the end of the " + "previous weekly cycle. Whichever of these possibilities results in the " + "highest amount is your maximum take for the week.", amount=constants.TAKE_THROTTLING_THRESHOLD[currency] ) }}

{{ _( "Takes are not limited if the team has only one member, or if the previous " "week's takes were all zero (which is the case for any new team that has " - "been created after the most recent payday)." + "been created during the current weekly cycle)." ) }}

{{ _(