forked from Gitlink/forgeplus
fix: organization gitea_token read by associations
This commit is contained in:
parent
2dfd69ae21
commit
8f5bb0e2d9
|
@ -83,6 +83,10 @@ class Organization < Owner
|
|||
|
||||
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
|
||||
Cache::V2::OwnerCommonService.new(self.id).reset
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ class Organizations::CreateService < ApplicationService
|
|||
end
|
||||
|
||||
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,
|
||||
location, repo_admin_change_team_access,
|
||||
visibility, max_repo_creation)
|
||||
|
|
Loading…
Reference in New Issue