解决了课程创建时设置私有依旧显示在课程列表的bug

This commit is contained in:
nieguanghui 2013-10-10 21:11:42 +08:00
parent 48a0f2f409
commit 8703709bd0
1 changed files with 1 additions and 1 deletions

View File

@ -515,7 +515,7 @@ class ProjectsController < ApplicationController
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])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
if params[:project][:is_public] == '1' || @course_tag=="1"
if (params[:project][:is_public] == '1' && @course_tag != "1") || (@course_tag=="1" && params[:project][:is_public] == '1')
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => @course_tag)
end
@project.members << m