BUGFIX: JS error when login_required is enabled

This commit is contained in:
Régis Hanol
2014-01-20 14:41:11 +01:00
parent 76a250300a
commit 26b7bf388e
3 changed files with 11 additions and 14 deletions

View File

@@ -58,16 +58,14 @@ class Site
def self.cached_json(guardian)
if guardian.anonymous? && SiteSetting.login_required
return {}.to_json
return {
periods: TopTopic.periods.map(&:to_s),
filters: Discourse.filters.map(&:to_s),
}.to_json
end
# Sam: bumping this way down, SiteSerializer will serialize post actions as well,
# On my local this was not being flushed as post actions types changed, it turn this
# broke local.
site = Site.new(guardian)
#Discourse.cache.fetch(site.cache_key, family: "site", expires_in: 1.minute) do
MultiJson.dump(SiteSerializer.new(site, root: false))
#end
end
def self.invalidate_cache