fix syntax error
This commit is contained in:
@@ -21,6 +21,13 @@ protected
|
||||
def enable_cors
|
||||
response.headers["Access-Control-Allow-Origin"] = "*"
|
||||
end
|
||||
|
||||
def require_shared_key
|
||||
unless params[:key] == Danbooru.config.shared_remote_key
|
||||
render(text: "forbidden", status: 403)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def api_check
|
||||
if request.format.to_s =~ /\/json|\/xml/ || params[:controller] == "iqdb"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class RelatedTagsController < ApplicationController
|
||||
respond_to :json
|
||||
before_filter :require_shared_key, only: [:update]
|
||||
|
||||
def show
|
||||
@query = RelatedTagQuery.new(params[:query].to_s.downcase, params[:category])
|
||||
@@ -11,8 +12,6 @@ class RelatedTagsController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
render(text: "forbidden", status: 403) && return false unless params[:key] == Danbooru.config.shared_remote_key
|
||||
|
||||
@tag = Tag.find_by_name(params[:name])
|
||||
@tag.related_tags = params[:related_tags].scan(/\S+/).in_groups_of(2)
|
||||
@tag.related_tags_updated_at = Time.now
|
||||
|
||||
Reference in New Issue
Block a user