Merge branch 'dev-homepage-revision' into 'develop'

修复版本库不存在时,管理员删除项目出错的bug

修复版本库不存在时,管理员删除项目出错的bug

See merge request !186
This commit is contained in:
陈晓婷 2019-10-11 13:39:08 +08:00
commit f3aa5c1718
1 changed files with 15 additions and 16 deletions

View File

@ -123,7 +123,7 @@ class ProjectsController < ApplicationController
def index def index
render_404 render_404
end end
def courserender_404 def courserender_404
end end
@ -158,7 +158,7 @@ class ProjectsController < ApplicationController
projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}") render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
} }
end end
end end
# Time 2015-01-29 16:13:20 # Time 2015-01-29 16:13:20
@ -191,11 +191,11 @@ class ProjectsController < ApplicationController
reply_user_id = params[:reference_user_id] reply_user_id = params[:reference_user_id]
reply_id = params[:reference_message_id] reply_id = params[:reference_message_id]
content = params[:project_respond] content = params[:project_respond]
options = {:user_id => author_id, options = {:user_id => author_id,
:m_parent_id => parent_id, :m_parent_id => parent_id,
:m_reply_id => reply_id, :m_reply_id => reply_id,
:reply_id => reply_user_id, :reply_id => reply_user_id,
:notes => content, :notes => content,
:is_readed => false} :is_readed => false}
@jfm = Project.add_new_jour(nil, nil, project_id, options) @jfm = Project.add_new_jour(nil, nil, project_id, options)
@ -223,7 +223,7 @@ class ProjectsController < ApplicationController
redirect_to signin_url redirect_to signin_url
end end
end end
def share def share
@shares = @project.shares.reverse @shares = @project.shares.reverse
@base_courses_tag = @project.project_type @base_courses_tag = @project.project_type
@ -1124,7 +1124,7 @@ class ProjectsController < ApplicationController
g.delete_project(@project.gpid) g.delete_project(@project.gpid)
# 删除Trustie版本库记录 # 删除Trustie版本库记录
repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first
repoisitory.delete repoisitory.delete unless repository.blank?
@project.update_column(:gpid, nil) @project.update_column(:gpid, nil)
@project.update_column(:forked_from_project_id, nil) @project.update_column(:forked_from_project_id, nil)
@project_to_destroy = @project @project_to_destroy = @project
@ -1175,27 +1175,27 @@ class ProjectsController < ApplicationController
format.js format.js
end end
end end
def issue_score_index def issue_score_index
respond_to do |format| respond_to do |format|
format.js format.js
end end
end end
def news_score_index def news_score_index
end end
def file_score_index def file_score_index
end end
def code_submit_score_index def code_submit_score_index
end end
def projects_topic_score_index def projects_topic_score_index
end end
# end # end
@ -1332,4 +1332,3 @@ class ProjectsController < ApplicationController
true true
end end
end end