FIX: compatibility after allowlist rewording in Discourse

This commit is contained in:
Krzysztof Kotlarek 2020-07-15 09:34:02 +10:00
parent 075883ba5a
commit 10c31ffbd5
1 changed files with 10 additions and 2 deletions

View File

@ -250,8 +250,16 @@ SQL
mount ::DiscourseSolved::Engine, at: "solution" mount ::DiscourseSolved::Engine, at: "solution"
end end
TopicView.add_post_custom_fields_whitelister do |user|
["is_accepted_answer"] # TODO Drop after Discourse 2.6.0 release
if TopicView.respond_to?(:add_post_custom_fields_whitelister)
TopicView.add_post_custom_fields_whitelister do |user|
["is_accepted_answer"]
end
else
TopicView.add_post_custom_fields_allowlister do |user|
["is_accepted_answer"]
end
end end
def get_schema_text(post) def get_schema_text(post)