Delete Spammer on admin/flags doesn't work for mods if "show_email_on_profile" setting is turned off


#1

Repro steps:

  1. Turn off the show_email_on_profile site setting;
  2. Flag a post created by a TL0 user as spam;
  3. Log into an account with moderation rights and no admin rights;
  4. Go to admin/flags, click Delete… and then select Delete Spammer

Results:
The modal closes and the following errors show up in the browser console (screenshot taken from my local install):


Based on the research I did around the flags area in the codebase, I think this fails (I could be totally wrong here) because at some point discourse tries to run a “check email” task (similar to the task the check email button on profiles has) on the spammer using the moderator account, but since disabling the show_email_on_profile setting seems to prevent moderators from checking email addresses (?), the check email task fails and consequently deleting the spammer fails as well.


"Delete Spammer" from "Flag" menu returns 403, doesn't work
"Delete Spammer" from "Flag" menu returns 403, doesn't work
(Régis Hanol) #2

I’m actually fixing something highly related. Will test your use case to see if it’s also fixed.

EDIT: yeah, seems to be the same issue. Will be deployed to your instance soonish.


(Jeff Atwood) #3