mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-10 17:25:35 +00:00
Pass correct user id in Move notification
We were passing the *requesting* user's moved_to value to the Move notification template, instead of the id of the user that they are being notified about. Additionally, the id_to_username template tag had no fallback for if the user_id is None. This resolves both problems and removes an unnecessary space in a template for when the logged in user made the move. Fixes #3196
This commit is contained in:
parent
b04ebe397b
commit
b990d9ccd8
3 changed files with 4 additions and 3 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
<div class="notification is-warning">
|
||||
<p>
|
||||
{% id_to_username request.user.moved_to as username %}
|
||||
{% id_to_username request.user.moved_to as username %}
|
||||
{% blocktrans trimmed with moved_to=user.moved_to %}
|
||||
<strong>You have moved your account</strong> to <a href="{{ moved_to }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
{% block description %}
|
||||
{% if related_user_moved_to %}
|
||||
{% id_to_username request.user.moved_to as username %}
|
||||
{% id_to_username related_user_moved_to as username %}
|
||||
{% blocktrans trimmed %}
|
||||
{{ related_user }} has moved to <a href="{{ related_user_moved_to }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
|
|
|
@ -125,7 +125,8 @@ def id_to_username(user_id):
|
|||
name = parts[-1]
|
||||
value = f"{name}@{domain}"
|
||||
|
||||
return value
|
||||
return value
|
||||
return "a new user account"
|
||||
|
||||
|
||||
@register.filter(name="get_file_size")
|
||||
|
|
Loading…
Reference in a new issue