DEV: add logo URL and locale details to the Discover stats. (#26320)

We will be collecting the logo URL and the site's default locale values along with existing basic details to display the site on the Discourse Discover listing page. It will be included only if the site is opted-in by enabling the "`include_in_discourse_discover`" site setting.

Also, we no longer going to use `about.json` and `site/statistics.json` endpoints retrieve these data. We will be using only the `site/basic-info.json` endpoint.
This commit is contained in:
Vinoth Kannan
2024-04-04 00:22:28 +05:30
committed by GitHub
parent 3e0898e498
commit 9dc6325821
9 changed files with 21 additions and 43 deletions

View File

@@ -637,6 +637,10 @@ class Guardian
other && authenticated? && other.is_a?(User) && @user == other
end
def is_discourse_hub_request?
request&.user_agent == "Discourse Hub"
end
private
def is_my_own?(obj)

View File

@@ -47,8 +47,4 @@ class Statistics
count: User.real.count,
}
end
def self.discourse_discover
{ enrolled: SiteSetting.include_in_discourse_discover? }
end
end