mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 05:48:23 +08:00
FIX: Show Privacy Policy or ToS when they exist (#21771)
Privacy Policy and Terms of Service topics are no longer created by default for communities that have not set a company name. For this reason, some URLs were pointing to 404 page.
This commit is contained in:
@ -6,14 +6,18 @@ module ConfigurableUrls
|
||||
end
|
||||
|
||||
def tos_path
|
||||
SiteSetting.tos_url.blank? ? "#{Discourse.base_path}/tos" : SiteSetting.tos_url
|
||||
if SiteSetting.tos_url.present?
|
||||
SiteSetting.tos_url
|
||||
elsif SiteSetting.tos_topic_id > 0 && Topic.exists?(id: SiteSetting.tos_topic_id)
|
||||
"#{Discourse.base_path}/tos"
|
||||
end
|
||||
end
|
||||
|
||||
def privacy_path
|
||||
if SiteSetting.privacy_policy_url.blank?
|
||||
"#{Discourse.base_path}/privacy"
|
||||
else
|
||||
if SiteSetting.privacy_policy_url.present?
|
||||
SiteSetting.privacy_policy_url
|
||||
elsif SiteSetting.privacy_topic_id > 0 && Topic.exists?(id: SiteSetting.privacy_topic_id)
|
||||
"#{Discourse.base_path}/privacy"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user