Richie
(Richie Rich)
12 Settembre 2025, 7:39am
1
Quando un utente viene eliminato rifiutando il suo primo post, gli viene inviata un’email con oggetto Il tuo account è stato eliminato.
C’è un bug nel corpo/contenuto dell’email, sembra che venga visualizzata una sorta di sintassi Ruby hash nella sezione centrale dell’email:
Ciao,
Questo è un messaggio automatico da NOME SITO per informarti che l’account utente associato a questo indirizzo email è stato eliminato da un membro dello staff.
{:off_topic=>“Il tuo post è stato segnalato come fuori tema : la community ritiene che non sia adatto all’argomento, così come definito attualmente dal titolo e dal primo post.”, :inappropriate=>“Il tuo post è stato segnalato come inappropriato : la community ritiene che sia offensivo, abusivo, condotta d’odio o una violazione delle nostre linee guida della community.”, :illegal=>“Il tuo post è stato segnalato come illegale : la community pensa che possa violare la legge.”, :spam=>“Il tuo post è stato segnalato come spam : la community ritiene che sia una pubblicità, qualcosa di eccessivamente promozionale invece di essere utile o pertinente all’argomento come previsto.”, :notify_moderators=>“Il tuo post è stato segnalato per attenzione dei moderatori : la community ritiene che qualcosa nel post richieda un intervento manuale da parte di un membro dello staff.”, :responder=>{:off_topic=>“Il post è stato segnalato come fuori tema : la community ritiene che non sia adatto all’argomento, così come definito attualmente dal titolo e dal primo post.”, :inappropriate=>“Il post è stato segnalato come inappropriato : la community ritiene che sia offensivo, abusivo, condotta d’odio o una violazione delle nostre linee guida della community.”, :spam=>“Il post è stato segnalato come spam : la community ritiene che sia una pubblicità, qualcosa di eccessivamente promozionale invece di essere utile o pertinente all’argomento come previsto.”, :notify_moderators=>“Il post è stato segnalato per attenzione dei moderatori : la community ritiene che qualcosa nel post richieda un intervento manuale da parte di un membro dello staff.”}}
Si prega di rivedere le nostre linee guida della community per i dettagli.
Passaggi per replicare:
Assicurati che Discourse richieda l’approvazione del primo post di ogni utente
Crea un nuovo utente
Crea un nuovo post con il nuovo utente
Utilizzando un account admin, rifiuta il post con l’opzione “Elimina utente”
Al nuovo utente viene inviata un’email con il contenuto sopra riportato
2 Mi Piace
Richie
(Richie Rich)
12 Settembre 2025, 7:41am
2
Se può essere d’aiuto, ecco un paio di screenshot dalla vista admin del post rifiutato:
Prima dell’eliminazione dell’utente:
Dopo il rifiuto e l’eliminazione:
1 Mi Piace
selase
(Selase Krakani)
Ha separato questo argomento il
18 Novembre 2025, 11:45am
3
selase
(Selase Krakani)
12 Settembre 2025, 6:24pm
4
Sembra un bug nel modo in cui flag_reason viene generato qui:
def account_deleted(email, reviewable)
post_action_type_id =
reviewable.reviewable_scores.first&.reviewable_score_type ||
PostActionTypeView.new.types[:spam]
build_email(
email,
template: "user_notifications.account_deleted",
flag_reason: I18n.t("flag_reasons.#{PostActionTypeView.new.types[post_action_type_id]}"),
)
end
PostActionTypeView.new.types non include il flag :needs_approval (che viene creato nel flusso descritto). A causa di ciò, la chiave di traduzione si risolve in flag_reasons. (senza suffisso), che restituisce l’intera sezione YAML invece di una singola voce. Ecco perché c’è un hash Ruby al posto del motivo del flag.
flag_reasons:
off_topic: "Your post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "Your post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
illegal: "Your post was flagged as **illegal**: the community thinks it might be breaking the law."
spam: "Your post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "Your post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
responder:
off_topic: "The post was flagged as **off-topic**: the community feels it is not a good fit for the topic, as currently defined by the title and the first post."
inappropriate: "The post was flagged as **inappropriate**: the community feels it is offensive, abusive, to be hateful conduct or a violation of [our community guidelines](%{base_path}/guidelines)."
spam: "The post was flagged as **spam**: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected."
notify_moderators: "The post was flagged **for moderator attention**: the community feels something about the post requires manual intervention by a staff member."
Inoltre, questo probabilmente influisce anche sui flag personalizzati, poiché anche le loro traduzioni sarebbero mancanti.
7 Mi Piace
Moin
12 Settembre 2025, 6:43pm
6
Sono sicuro che lo fa. L’ho menzionato a maggio
Moin:
Moin:
Nota a margine:
3 Mi Piace
selase
(Selase Krakani)
18 Novembre 2025, 11:51am
7
Abbiamo unito una correzione per il problema nell’OP. Ho spostato il report relativo agli utenti “staged” in un topic separato per facilitarne il monitoraggio in attesa di una correzione.
main ← fix/deleted-user-email
opened 04:43PM - 24 Sep 25 UTC
`UserNotifications#account_deleted` builds a localized flag reason from the revi… ewable’s first `reviewable_score` (falling back to `spam` if none is found).
Currently, some score types (e.g. `needs_approval`) are not covered. In cases where a "Needs Approval" flag led to an account deletion, the lookup key could end up as `flag_reasons.`, causing the entire `flag_reasons`
section to be rendered instead of a single entry.
This change adds support for additional score types (like `needs_approval`). If no translation exists (e.g. custom flags), the flag’s description will be used if available, before falling back to the default `spam` reason.
More context: https://meta.discourse.org/t/ruby-hash-syntax-being-displayed-in-emails-sent-to-deleted-users/382411
1 Mi Piace