更改:查询项目排除.json
This commit is contained in:
parent
39a851b74b
commit
eabf404682
|
@ -380,7 +380,13 @@ class Project < ApplicationRecord
|
|||
|
||||
user = Owner.find_by_login namespace_path
|
||||
user = User.new(login: namespace_path) if user.nil?
|
||||
project = user&.projects&.find_by(identifier: identifier) || Project.find_by(identifier: "#{namespace_path}/#{identifier}")
|
||||
if identifier.end_with?('.json')
|
||||
project = user&.projects&.find_by(identifier: identifier) || Project.find_by(identifier: "#{namespace_path}/#{identifier}")
|
||||
identifier = identifier.sub(/.*\K.json/, '')
|
||||
project = user&.projects&.find_by(identifier: identifier) || Project.find_by(identifier: "#{namespace_path}/#{identifier}")
|
||||
else
|
||||
project = user&.projects&.find_by(identifier: identifier) || Project.find_by(identifier: "#{namespace_path}/#{identifier}")
|
||||
end
|
||||
return nil if project.blank?
|
||||
|
||||
[project, user]
|
||||
|
|
Loading…
Reference in New Issue