Merge branch 'standalone_develop' into pm_project_develop

This commit is contained in:
2024-07-11 10:07:20 +08:00
72 changed files with 457 additions and 114 deletions

View File

@@ -216,4 +216,9 @@ class Organization < Owner
ids.uniq.size
end
# user容错处理
def get_letter_avatar_url
""
end
end

View File

@@ -182,14 +182,14 @@ class Project < ApplicationRecord
end
if changes[:is_public].present?
if changes[:is_public][0] && !changes[:is_public][1]
CacheAsyncClearJob.perform_later('project_rank_service', self.id)
CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id)
end
if !changes[:is_public][0] && changes[:is_public][1]
$redis_cache.srem("v2-project-rank-deleted", self.id)
end
end
if !self.common?
CacheAsyncClearJob.perform_later('project_rank_service', self.id)
CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id)
end
end
@@ -458,6 +458,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?

View File

@@ -833,7 +833,11 @@ class User < Owner
end
def admin_or_business?
admin? || business?
admin? || business?
end
def admin_or_glcc_admin?
admin? || glcc_admin?
end
def self.generate_login(prefix)