mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
allow full access to /admin/backups while in read-only mode
This commit is contained in:
parent
0e941a6253
commit
5725f02d9e
@ -87,8 +87,7 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
rescue_from Discourse::ReadOnly do
|
rescue_from Discourse::ReadOnly do
|
||||||
# can this happen on a not .json format?
|
render status: 405, json: failed_json.merge(message: I18n.t("read_only_mode_enabled"))
|
||||||
render json: failed_json.merge(message: I18n.t("read_only_mode_enabled"))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def rescue_discourse_actions(message, error)
|
def rescue_discourse_actions(message, error)
|
||||||
@ -283,8 +282,8 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def block_if_readonly_mode
|
def block_if_readonly_mode
|
||||||
return if request.put? && request.fullpath == "/admin/backups/readonly"
|
return if request.fullpath.start_with?("/admin/backups")
|
||||||
raise Discourse::ReadOnly.new unless request.get? || !Discourse.readonly_mode?
|
raise Discourse::ReadOnly.new if !request.get? && Discourse.readonly_mode?
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_not_found_page(status=404, layout=false)
|
def build_not_found_page(status=404, layout=false)
|
||||||
|
@ -27,6 +27,8 @@ en:
|
|||||||
backup:
|
backup:
|
||||||
operation_already_running: "An operation is currently running. Can't start a new job right now."
|
operation_already_running: "An operation is currently running. Can't start a new job right now."
|
||||||
|
|
||||||
|
read_only_mode_enabled: "The site is in read only mode. Interactions are disabled."
|
||||||
|
|
||||||
too_many_replies:
|
too_many_replies:
|
||||||
one: "We're sorry, but new users are temporarily limited to 1 reply in the same topic."
|
one: "We're sorry, but new users are temporarily limited to 1 reply in the same topic."
|
||||||
other: "We're sorry, but new users are temporarily limited to %{count} replies in the same topic."
|
other: "We're sorry, but new users are temporarily limited to %{count} replies in the same topic."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user