编辑课程的时候如果没有输密码,那就用原来的密码

This commit is contained in:
lizanle 2015-04-09 16:05:51 +08:00
parent 590dd0cac5
commit d0562f1ede
1 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,10 @@ module Mobile
class_period: params[:class_period]
}
course = ::Course.find(params[:course_id])
# 如果没有传密码过来,那就把原来的密码给上,不然会不更新
if params[:password].nil? || params[:password].blank?
cs_params[:course][:password] = course[:password]
end
cs.edit_course_authorize(current_user,course)
course = cs.edit_course(cs_params, course,current_user)
present :data, course, with: Mobile::Entities::Course