FIX: discobot inappropriate flag section

Ensure that the inappropriate flag is used and not some other flag
type. If some other flag is used a message will be posted letting the
user know they used the wrong flag and the original flag will be removed
so that they can try again.

Bug reported on meta: https://meta.discourse.org/t/-/157075
This commit is contained in:
Blake Erickson
2020-08-03 19:38:04 -06:00
parent 8246b611ac
commit 18dad4cfbd
4 changed files with 25 additions and 5 deletions

View File

@ -223,8 +223,8 @@ after_initialize do
if self.post && self.user.enqueue_narrative_bot_job?
input =
case self.post_action_type_id
when *PostActionType.flag_types_without_custom.values
:flag
when *PostActionType.flag_types.values
self.post_action_type_id == PostActionType.types[:inappropriate] ? :flag : :reply
when PostActionType.types[:like]
:like
when PostActionType.types[:bookmark]