Fix #2795: "check_availability" bug with saved searches.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
module SavedSearches
|
||||
module CheckAvailability
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_filter :check_availability
|
||||
end
|
||||
|
||||
def check_availability
|
||||
if !SavedSearch.enabled?
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
flash[:notice] = "Listbooru service is not configured. Saved searches are not available."
|
||||
redirect_to :back
|
||||
end
|
||||
format.json do
|
||||
render json: {success: false, reason: "Listbooru service is not configured"}.to_json, status: 501
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user