mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
FIX: better error message when forum is in read-only mode
This commit is contained in:
parent
86fb08d04a
commit
2c0574010a
@ -1,4 +1,6 @@
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
function exportEntityByType(type, entity, args) {
|
||||
return ajax("/export_csv/export_entity.json", {
|
||||
method: "POST",
|
||||
@ -11,9 +13,7 @@ export function exportUserArchive() {
|
||||
.then(function() {
|
||||
bootbox.alert(I18n.t("user.download_archive.success"));
|
||||
})
|
||||
.catch(function() {
|
||||
bootbox.alert(I18n.t("user.download_archive.rate_limit_error"));
|
||||
});
|
||||
.catch(popupAjaxError);
|
||||
}
|
||||
|
||||
export function exportEntity(entity, args) {
|
||||
|
@ -9,6 +9,8 @@ class ExportCsvController < ApplicationController
|
||||
Jobs.enqueue(:export_csv_file, entity: export_params[:entity], user_id: current_user.id, args: export_params[:args])
|
||||
StaffActionLogger.new(current_user).log_entity_export(export_params[:entity])
|
||||
render json: success_json
|
||||
rescue Discourse::InvalidAccess
|
||||
return render_json_error I18n.t("csv_export.rate_limit_error")
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -575,7 +575,6 @@ en:
|
||||
attributes:
|
||||
word:
|
||||
too_many: "Too many words for that action"
|
||||
|
||||
|
||||
uncategorized_category_name: "Uncategorized"
|
||||
|
||||
@ -3760,6 +3759,7 @@ en:
|
||||
csv_export:
|
||||
boolean_yes: "Yes"
|
||||
boolean_no: "No"
|
||||
rate_limit_error: "Posts can be downloaded once per day, please try again tomorrow."
|
||||
|
||||
static_topic_first_reply: |
|
||||
Edit the first post in this topic to change the contents of the %{page_name} page.
|
||||
|
Loading…
Reference in New Issue
Block a user