Fix ModerationLog FunctionClauseError for unknown actions
Add catchall clause to handle log entries with unknown actions or malformed data. Prevents HTTP 500 errors in admin moderation log view. Fixes #3385
This commit is contained in:
parent
d24e6eaf39
commit
bde52824d3
2 changed files with 39 additions and 0 deletions
|
|
@ -575,6 +575,12 @@ defmodule Pleroma.ModerationLog do
|
|||
"@#{actor_nickname} requested account backup for @#{user_nickname}"
|
||||
end
|
||||
|
||||
def get_log_entry_message(%ModerationLog{data: data}) do
|
||||
actor_name = get_in(data, ["actor", "nickname"]) || "unknown"
|
||||
action = data["action"] || "unknown"
|
||||
"@#{actor_name} performed action #{action}"
|
||||
end
|
||||
|
||||
defp nicknames_to_string(nicknames) do
|
||||
nicknames
|
||||
|> Enum.map(&"@#{&1}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue