add: reversed keyword tip_exception

This commit is contained in:
2021-09-03 17:30:44 +08:00
parent f1586c320b
commit 9926bff60d
3 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ class Organizations::OrganizationsController < Organizations::BaseController
def create
ActiveRecord::Base.transaction do
return render_forbidden('该组织标识为系统保留关键字.') if ReversedKeyword.is_reversed(organization_params[:name]).present?
tip_exception("无法使用以下关键词:#{organization_params[:name]},请重新命名") if ReversedKeyword.is_reversed(organization_params[:name]).present?
Organizations::CreateForm.new(organization_params).validate!
@organization = Organizations::CreateService.call(current_user, organization_params)
Util.write_file(@image, avatar_path(@organization)) if params[:image].present?