[FIX]owner text

This commit is contained in:
viletyy 2021-02-04 17:30:49 +08:00
parent 54204d4db8
commit 55528950f1
3 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ class Organizations::OrganizationUsersController < Organizations::BaseController
end
def destroy
tip_exception("您不能从 Owner 团队中删除最后一个用户") if @organization.is_owner_team_last_one?(@operate_user.id)
tip_exception("您不能从所有者团队中删除最后一个用户") if @organization.is_owner_team_last_one?(@operate_user.id)
ActiveRecord::Base.transaction do
@organization_user.destroy!
TeamUser.where(organization_id: @organization.id, user_id: @operate_user.id).map{|u| u.destroy!}
@ -26,7 +26,7 @@ class Organizations::OrganizationUsersController < Organizations::BaseController
def quit
@organization_user = @organization.organization_users.find_by(user_id: current_user.id)
tip_exception("您不在该组织中") if @organization_user.nil?
tip_exception("您不能从 Owner 团队中删除最后一个用户") if @organization.is_owner_team_last_one?(current_user.id)
tip_exception("您不能从所有者团队中删除最后一个用户") if @organization.is_owner_team_last_one?(current_user.id)
ActiveRecord::Base.transaction do
@organization_user.destroy!
TeamUser.where(organization_id: @organization.id, user_id: current_user.id).map{|u| u.destroy!}

View File

@ -25,7 +25,7 @@ class Organizations::TeamUsersController < Organizations::BaseController
end
def destroy
tip_exception("您不能从 Owner 团队中删除最后一个用户") if @team.owner? && @organization.is_owner_team_last_one?(@operate_user.id)
tip_exception("您不能从所有者团队中删除最后一个用户") if @team.owner? && @organization.is_owner_team_last_one?(@operate_user.id)
ActiveRecord::Base.transaction do
@team_user.destroy!
Gitea::Organization::TeamUser::DeleteService.call(@organization.gitea_token, @team.gtid, @operate_user.login)
@ -39,7 +39,7 @@ class Organizations::TeamUsersController < Organizations::BaseController
def quit
@team_user = @team.team_users.find_by(user_id: current_user.id)
tip_exception("您不在该组织团队中") if @team_user.nil?
tip_exception("您不能从 Owner 团队中删除最后一个用户") if @team.owner? && @organization.is_owner_team_last_one?(current_user.id)
tip_exception("您不能从所有者团队中删除最后一个用户") if @team.owner? && @organization.is_owner_team_last_one?(current_user.id)
ActiveRecord::Base.transaction do
@team_user.destroy!
Gitea::Organization::TeamUser::DeleteService.call(@organization.gitea_token, @team.gtid, current_user.login)

View File

@ -54,7 +54,7 @@ class Organizations::CreateService < ApplicationService
end
def create_owner_info
@owner_team = Team.build(organization.id, "Owner", "", 4, true, true)
@owner_team = Team.build(organization.id, "Owners", "", 4, true, true)
TeamUnit.unit_types.keys.each do |u_type|
TeamUnit.build(organization.id, owner_team.id, u_type)
end