Make if more comprehensive

This commit is contained in:
amcmanu3 2023-09-04 18:44:17 -04:00
parent 24f9b64d59
commit 3cb18f2da4

View File

@ -81,18 +81,17 @@ class ApiImportFilesIndexHandler(BaseApiHandler):
}, },
) )
else: else:
if not self.helper.check_path_exists(folder): if not self.helper.check_path_exists(folder) and user_id:
if user_id: user_lang = self.controller.users.get_user_lang_by_id(user_id)
user_lang = self.controller.users.get_user_lang_by_id(user_id) self.helper.websocket_helper.broadcast_user(
self.helper.websocket_helper.broadcast_user( user_id,
user_id, "send_start_error",
"send_start_error", {
{ "error": self.helper.translation.translate(
"error": self.helper.translation.translate( "error", "no-file", user_lang
"error", "no-file", user_lang )
) },
}, )
)
return_json = { return_json = {
"root_path": { "root_path": {
"path": folder, "path": folder,