FIX: Hashtag error in PrettyText when processing email (#22680)

Followup to b583872eed
and 54001060ea

Another place where we need to filter hashtag types to
only enabled ones is PrettyText, though the latter PR
above should also already make it so the correct priority
types are passed.

This is causing errors in the email processing workflow
for some customers (presumably ones with tagging disabled).
This commit is contained in:
Martin Brennan
2023-07-19 10:52:18 +10:00
committed by GitHub
parent 7cee80d699
commit 3be9e6c97e
2 changed files with 12 additions and 0 deletions

View File

@@ -125,6 +125,11 @@ module PrettyText
cooking_user = User.find(cooking_user_id)
end
types_in_priority_order =
types_in_priority_order.select do |type|
HashtagAutocompleteService.data_source_types.include?(type)
end
result =
HashtagAutocompleteService.new(Guardian.new(cooking_user)).lookup(
[slug],