新增:项目开启用户画像使用配置

This commit is contained in:
yystopf 2024-06-03 14:25:18 +08:00
parent 07918dbb04
commit 1b4ca03ac7
2 changed files with 5 additions and 0 deletions

View File

@ -68,6 +68,7 @@ module ProjectsHelper
cloud_ide_saas_url: cloud_ide_saas_url(user),
open_blockchain: Site.has_blockchain? && project.use_blockchain,
has_dataset: project.project_dataset.present?,
open_portrait: project.open_portrait,
ignore_id: project.ignore_id
}).compact

View File

@ -457,6 +457,10 @@ class Project < ApplicationRecord
$redis_cache.hdel("issue_cache_delete_count", self.id)
end
def open_portrait
EduSetting.get("open_portrait_projects").present? ? EduSetting.get("open_portrait_projects").split(",").include?(self.id.to_s) : false
end
def self.mindspore_contributors
cache_result = $redis_cache.get("ProjectMindsporeContributors")
if cache_result.nil?