Skip to content

Commit

Permalink
fix(auditlog): fix formatting authentication method
Browse files Browse the repository at this point in the history
The formatting was applied to HTML formatted method.

Fixes #12909
  • Loading branch information
nijel committed Nov 2, 2024
1 parent ff35bfe commit 41e9226
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Not yet released.

**Bug fixes**

* Formatting of some :ref:`audit-log` entries.

**Compatibility**

**Upgrading**
Expand Down
7 changes: 3 additions & 4 deletions weblate/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,13 @@ def get_params(self):
value = format_html("<em>{}</em>", value)
elif name in {"old", "new", "name", "email", "username"}:
value = format_html("<code>{}</code>", mail_quote_value(value))
elif name in {"device", "project", "site_title", "method"}:
elif name == "method":
value = format_html("<strong>{}</strong>", get_auth_name(value))
elif name in {"device", "project", "site_title"}:
value = format_html("<strong>{}</strong>", mail_quote_value(value))

result[name] = value

if "method" in result:
# The gettext is here for legacy entries which contained method name
result["method"] = gettext(get_auth_name(result["method"]))
return result

@admin.display(description=gettext_lazy("Account activity"))
Expand Down

0 comments on commit 41e9226

Please sign in to comment.