Richie
(Richie Rich)
12 בספטמבר, 2025, 7:39am
1
כאשר משתמש נמחק על ידי דחיית הפוסט הראשון שלו, נשלחת אליו אימייל עם שורת הנושא חשבונך נמחק.
קיימת שגיאה בגוף / בתוכן האימייל, נראה שהוא מציג סוג של תחביר Ruby hash בחלק האמצעי של האימייל:
שלום,
זוהי הודעה אוטומטית מ-שם האתר כדי ליידע אותך שחשבון המשתמש המשויך לכתובת דוא"ל זו נמחק על ידי איש צוות.
{:off_topic=>“הפוסט שלך סומן כ-לא רלוונטי : הקהילה מרגישה שהוא אינו מתאים לנושא, כפי שהוגדר כעת על ידי הכותרת והפוסט הראשון.”, :inappropriate=>“הפוסט שלך סומן כ-לא הולם : הקהילה מרגישה שהוא פוגעני, מעליב, התנהגות שנאה או הפרה של הנחיות הקהילה שלנו.”, :illegal=>“הפוסט שלך סומן כ-לא חוקי : הקהילה חושבת שהוא עלול להפר את החוק.”, :spam=>“הפוסט שלך סומן כ-ספאם : הקהילה מרגישה שהוא פרסומת, משהו שהוא קידום יתר באופן מוגזם במקום להיות שימושי או רלוונטי לנושא כמצופה.”, :notify_moderators=>“הפוסט שלך סומן לתשומת לב המנהלים : הקהילה מרגישה שמשהו בפוסט דורש התערבות ידנית של איש צוות.”, :responder=>{:off_topic=>“הפוסט סומן כ-לא רלוונטי : הקהילה מרגישה שהוא אינו מתאים לנושא, כפי שהוגדר כעת על ידי הכותרת והפוסט הראשון.”, :inappropriate=>“הפוסט סומן כ-לא הולם : הקהילה מרגישה שהוא פוגעני, מעליב, התנהגות שנאה או הפרה של הנחיות הקהילה שלנו.”, :spam=>“הפוסט סומן כ-ספאם : הקהילה מרגישה שהוא פרסומת, משהו שהוא קידום יתר באופן מוגזם במקום להיות שימושי או רלוונטי לנושא כמצופה.”, :notify_moderators=>“הפוסט סומן לתשומת לב המנהלים : הקהילה מרגישה שמשהו בפוסט דורש התערבות ידנית של איש צוות.”}}
אנא עיין בהנחיות הקהילה שלנו לקבלת פרטים.
שלבים לשחזור:
ודא ש-Discourse דורש אישור של הפוסט הראשון של כל משתמש
צור משתמש חדש
צור פוסט חדש עם המשתמש החדש
באמצעות חשבון מנהל, דחה את הפוסט עם האפשרות “מחק משתמש”
המשתמש החדש מקבל אימייל עם התוכן הנ"ל
2 לייקים
Richie
(Richie Rich)
12 בספטמבר, 2025, 7:41am
2
If it helps, a couple of screen shots from the admin view of the rejected post:
Before deleting the user:
After rejection and deletion:
לייק 1
selase
(Selase Krakani)
נושא זה פוצל ב־
18 בנובמבר, 2025, 11:45am
3
selase
(Selase Krakani)
12 בספטמבר, 2025, 6:24pm
4
This looks like a bug in how flag_reason is generated here:
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 doesn’t include :needs_approval flag (which gets created in the flow described). Because of this, the translation key resolves to flag_reasons. (with no suffix), which returns the entire YAML section instead of a single entry. That’s why there is a Ruby hash in place of the flag reason.
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."
Relatedly, this likely impacts custom flags as well, since their translations would also be missing.
7 לייקים
Moin
12 בספטמבר, 2025, 6:43pm
6
I am sure it does. I mentioned that in May
3 לייקים
selase
(Selase Krakani)
18 בנובמבר, 2025, 11:51am
7
We’ve merged a fix for the issue in the OP. I’ve moved the report related to staged users into its own topic to make it easier to track pending a fix.
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