Merge branch 'develop' into standalone_develop
This commit is contained in:
commit
345fd31834
|
@ -83,6 +83,10 @@ class Organization < Owner
|
||||||
|
|
||||||
after_save :reset_cache_data
|
after_save :reset_cache_data
|
||||||
|
|
||||||
|
def gitea_token
|
||||||
|
team_users.joins(:team).where(teams: {authorize: "owner"}).take&.user&.gitea_token
|
||||||
|
end
|
||||||
|
|
||||||
def reset_cache_data
|
def reset_cache_data
|
||||||
Cache::V2::OwnerCommonService.new(self.id).reset
|
Cache::V2::OwnerCommonService.new(self.id).reset
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Organizations::CreateService < ApplicationService
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_org_and_extension
|
def create_org_and_extension
|
||||||
@organization = Organization.build(params[:name], params[:nickname], user.gitea_token)
|
@organization = Organization.build(params[:name], params[:nickname])
|
||||||
org_extension = OrganizationExtension.build(organization.id, description, website,
|
org_extension = OrganizationExtension.build(organization.id, description, website,
|
||||||
location, repo_admin_change_team_access,
|
location, repo_admin_change_team_access,
|
||||||
visibility, max_repo_creation)
|
visibility, max_repo_creation)
|
||||||
|
|
Loading…
Reference in New Issue