diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 65a450274..ae4259277 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -110,7 +110,7 @@ class RepositoriesController < ApplicationController end def commits_slice - @hash_commit = Gitea::Repository::Commits::ListSliceService.call(@owner.login, @project.identifier, + @hash_commit = Gitea::Repository::Commits::ListSliceService.call(@owner&.login, @project.identifier, sha: params[:sha], page: params[:page], limit: params[:limit], token: current_user&.gitea_token) end diff --git a/app/models/project.rb b/app/models/project.rb index 311f670b8..2ba5d5cf3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -365,7 +365,6 @@ class Project < ApplicationRecord logger.info "########namespace_path: #{namespace_path} ########identifier: #{identifier} " user = Owner.find_by_login namespace_path - user = Owner.new(login: namespace_path) if user.nil? project = user&.projects&.find_by(identifier: identifier) || Project.find_by(identifier: "#{namespace_path}/#{identifier}") return nil if project.blank?