#1657 新建课程时如用户没有对应的身份、姓名信息,跳转到修改资料界面
This commit is contained in:
parent
1084cda730
commit
4d9fc8d74f
|
@ -266,12 +266,11 @@ class CoursesController < ApplicationController
|
|||
@course.setup_time = params[:setup_time]
|
||||
@course.endup_time = params[:endup_time]
|
||||
@course.class_period = params[:class_period]
|
||||
end
|
||||
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
|
||||
if @course.save
|
||||
if @course.save
|
||||
#unless User.current.admin?
|
||||
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
m = Member.new(:user => User.current, :roles => [r])
|
||||
|
@ -297,13 +296,16 @@ class CoursesController < ApplicationController
|
|||
}
|
||||
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) }
|
||||
end
|
||||
else
|
||||
else
|
||||
#@course.destroy
|
||||
respond_to do |format|
|
||||
format.html { render :action => 'new', :layout => 'base' } #Added by young
|
||||
format.api { render_validation_errors(@course) }
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
redirect_to my_account_url
|
||||
end
|
||||
end
|
||||
|
||||
def course
|
||||
|
|
Loading…
Reference in New Issue