|
|
|
@ -328,7 +328,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
|
|
|
|
|
def current_user
|
|
|
|
|
# User.current
|
|
|
|
|
User.find_by_id 50207
|
|
|
|
|
User.find_by_id 36401
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
## 默认输出json
|
|
|
|
@ -627,6 +627,16 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
error.backtrace.each { |msg| Rails.logger.error(msg) }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def find_user
|
|
|
|
|
@user = User.find_by_login params[:login]
|
|
|
|
|
render_not_found unless @user
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def find_repository
|
|
|
|
|
@repo = @user.repositories.find_by_identifier params[:repo_identifier]
|
|
|
|
|
render_not_found unless @repo
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def object_not_found
|
|
|
|
|
uid_logger("Missing template or cant't find record, responding with 404")
|
|
|
|
|