diff --git a/src/web/partials/admin/editor.html b/src/web/partials/admin/editor.html
index b386fa1f..fa8f08c8 100644
--- a/src/web/partials/admin/editor.html
+++ b/src/web/partials/admin/editor.html
@@ -9,42 +9,49 @@
Générateur de documentation à partir de Google Drive Spreadsheet
Cet outil permet d'ouvrir un fichier sur Google Drive Spreadsheet, d'itérer dans le document pour extraire les données, valider le formatage du document et générer la base de donnée du manuel du
joueur.
-
- Identifiant du document : {{! model_editor.info.sh_config.file_key }}
-
-
- Nom du document : {{! model_editor.info.sh_config.file_name }}
-
-
-
-
-
diff --git a/src/web/py_class/doc_generator_google_drive_spreadsheet.py b/src/web/py_class/doc_generator_google_drive_spreadsheet.py
index 40550d59..19ebbd05 100644
--- a/src/web/py_class/doc_generator_google_drive_spreadsheet.py
+++ b/src/web/py_class/doc_generator_google_drive_spreadsheet.py
@@ -42,7 +42,11 @@ def connect(self, url=None, stop_if_open=True):
return {"error": msg}
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
- credentials = ServiceAccountCredentials.from_json_keyfile_name(self._parser.db_google_API_path, scope)
+ try:
+ credentials = ServiceAccountCredentials.from_json_keyfile_name(self._parser.db_google_API_path, scope)
+ except FileNotFoundError:
+ msg = "Missing file %s to configure Google Drive Spreadsheets." % self._parser.db_google_API_path
+ return {"error": msg}
self._email_soft = credentials.service_account_email
self._gc = gspread.authorize(credentials)
diff --git a/src/web/resources/js/tl_module/editor_ctrl/editor_ctrl.js b/src/web/resources/js/tl_module/editor_ctrl/editor_ctrl.js
index 01483e12..c30f7e33 100644
--- a/src/web/resources/js/tl_module/editor_ctrl/editor_ctrl.js
+++ b/src/web/resources/js/tl_module/editor_ctrl/editor_ctrl.js
@@ -4,6 +4,12 @@
characterApp.controller("editor_ctrl", ["$scope", "$q", "$http", "$window", /*"$timeout",*/ function ($scope, $q, $http, $window) {
$scope.model_editor = {
is_ctrl_ready: false,
+
+ module_sh_state: {
+ has_error: false,
+ error: ""
+ },
+
info: {
sh_config: {
file_url: ""
@@ -12,6 +18,7 @@ characterApp.controller("editor_ctrl", ["$scope", "$q", "$http", "$window", /*"$
sh_has_access_perm: false,
email_soft: ""
},
+
update_file_info: {
status: {
enabled: false,
@@ -20,6 +27,7 @@ characterApp.controller("editor_ctrl", ["$scope", "$q", "$http", "$window", /*"$
},
url: ""
},
+
is_updating_file_info: false,
is_generating_doc: false,
generated_doc: {
@@ -41,6 +49,11 @@ characterApp.controller("editor_ctrl", ["$scope", "$q", "$http", "$window", /*"$
}).then(function (response/*, status, headers, config*/) {
$scope.model_editor.info = response.data;
$scope.model_editor.is_ctrl_ready = true;
+
+ if ("error" in $scope.model_editor.info) {
+ $scope.model_editor.module_sh_state.has_error = true;
+ $scope.model_editor.module_sh_state.error = $scope.model_editor.info.error;
+ }
}, function errorCallback(response) {
console.error(response);