mirror of
https://github.com/discourse/discourse.git
synced 2025-04-16 20:59:06 +08: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 { ajax } from "discourse/lib/ajax";
|
||||||
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
function exportEntityByType(type, entity, args) {
|
function exportEntityByType(type, entity, args) {
|
||||||
return ajax("/export_csv/export_entity.json", {
|
return ajax("/export_csv/export_entity.json", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@ -11,9 +13,7 @@ export function exportUserArchive() {
|
|||||||
.then(function() {
|
.then(function() {
|
||||||
bootbox.alert(I18n.t("user.download_archive.success"));
|
bootbox.alert(I18n.t("user.download_archive.success"));
|
||||||
})
|
})
|
||||||
.catch(function() {
|
.catch(popupAjaxError);
|
||||||
bootbox.alert(I18n.t("user.download_archive.rate_limit_error"));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function exportEntity(entity, args) {
|
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])
|
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])
|
StaffActionLogger.new(current_user).log_entity_export(export_params[:entity])
|
||||||
render json: success_json
|
render json: success_json
|
||||||
|
rescue Discourse::InvalidAccess
|
||||||
|
return render_json_error I18n.t("csv_export.rate_limit_error")
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -575,7 +575,6 @@ en:
|
|||||||
attributes:
|
attributes:
|
||||||
word:
|
word:
|
||||||
too_many: "Too many words for that action"
|
too_many: "Too many words for that action"
|
||||||
|
|
||||||
|
|
||||||
uncategorized_category_name: "Uncategorized"
|
uncategorized_category_name: "Uncategorized"
|
||||||
|
|
||||||
@ -3760,6 +3759,7 @@ en:
|
|||||||
csv_export:
|
csv_export:
|
||||||
boolean_yes: "Yes"
|
boolean_yes: "Yes"
|
||||||
boolean_no: "No"
|
boolean_no: "No"
|
||||||
|
rate_limit_error: "Posts can be downloaded once per day, please try again tomorrow."
|
||||||
|
|
||||||
static_topic_first_reply: |
|
static_topic_first_reply: |
|
||||||
Edit the first post in this topic to change the contents of the %{page_name} page.
|
Edit the first post in this topic to change the contents of the %{page_name} page.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user