modified API error message for knowledge file cannot be removed from disk
parent
14d0b7aa77
commit
16630dc30e
|
@ -834,6 +834,7 @@ function config($translateProvider) {
|
||||||
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
||||||
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
||||||
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
||||||
|
KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK: 'Knowledge File Cannot be Removed from Disk',
|
||||||
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
||||||
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
||||||
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
||||||
|
@ -1821,6 +1822,7 @@ function config($translateProvider) {
|
||||||
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
||||||
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
||||||
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
||||||
|
KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK: 'Knowledge File Cannot be Removed from Disk',
|
||||||
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
||||||
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
||||||
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
||||||
|
@ -2807,6 +2809,7 @@ function config($translateProvider) {
|
||||||
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
INVALID_VIRTUAL_METER_NAME: 'Invalid Virtual Meter Name',
|
||||||
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
INVALID_WEB_MESSAGE_ID: 'Invalid Web Message ID',
|
||||||
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
INVALID_WECHAT_MESSAGE_ID: 'Invalid Wechat Message ID',
|
||||||
|
KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK: 'Knowledge File Cannot be Removed from Disk',
|
||||||
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
KNOWLEDGE_FILE_NOT_FOUND: 'Knowledge File Not Found',
|
||||||
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY: 'Master Meter Does Not Belong To Same Energy Category',
|
||||||
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
MASTER_METER_NOT_FOUND: 'Master Meter Not Found',
|
||||||
|
|
|
@ -257,12 +257,11 @@ class KnowledgeFileItem:
|
||||||
file_uuid = row[0]
|
file_uuid = row[0]
|
||||||
# Define file_path
|
# Define file_path
|
||||||
file_path = os.path.join(config.upload_path, file_uuid)
|
file_path = os.path.join(config.upload_path, file_uuid)
|
||||||
|
|
||||||
# remove the file from disk
|
# remove the file from disk
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR',
|
raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR',
|
||||||
description='API.KNOWLEDGE_FILE_NOT_FOUND')
|
description='API.KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK')
|
||||||
|
|
||||||
cursor.execute(" DELETE FROM tbl_knowledge_files WHERE id = %s ", (id_,))
|
cursor.execute(" DELETE FROM tbl_knowledge_files WHERE id = %s ", (id_,))
|
||||||
cnx.commit()
|
cnx.commit()
|
||||||
|
|
|
@ -42,17 +42,26 @@ npx -v
|
||||||
```
|
```
|
||||||
|
|
||||||
* Open the “myems/web” directory with your cmd or terminal
|
* Open the “myems/web” directory with your cmd or terminal
|
||||||
* Run 'sudo npm i --unsafe-perm=true --allow-root'
|
```bash
|
||||||
|
cd myems/web
|
||||||
|
sudo npm i --unsafe-perm=true --allow-root
|
||||||
|
```
|
||||||
|
|
||||||
This command will download all the necessary dependencies for falcon in the node_modules directory.
|
This command will download all the necessary dependencies for falcon in the node_modules directory.
|
||||||
* If you modified any scss files, then you need to compile SCSS
|
* If you modified any scss files, then you need to compile SCSS
|
||||||
Run 'sudo npm run scss' command in your project directory to compile scss.
|
Run below command in your project directory to compile scss.
|
||||||
|
```bash
|
||||||
|
sudo npm run scss
|
||||||
|
```
|
||||||
* Run 'sudo npm start'
|
* Run 'sudo npm start'
|
||||||
A local web server will start at http://localhost:3000.
|
A local web server will start at http://localhost:3000.
|
||||||
We are using webpack and webpack-serve to automatically detect file changes. So, if you edit and save a file, your browser will automatically refresh and preview the change.
|
We are using webpack and webpack-serve to automatically detect file changes. So, if you edit and save a file, your browser will automatically refresh and preview the change.
|
||||||
|
|
||||||
## Creating a Production Build
|
## Creating a Production Build
|
||||||
* Run 'sudo npm run build' command in your project directory to make the Production build.
|
* Run below command in your project directory to make the Production build.
|
||||||
|
```bash
|
||||||
|
sudo npm run build
|
||||||
|
```
|
||||||
|
|
||||||
This will create an optimized production build by compililing, merging and minifying all the source files as necessary and put them in the build/ folder.
|
This will create an optimized production build by compililing, merging and minifying all the source files as necessary and put them in the build/ folder.
|
||||||
|
|
||||||
|
|
|
@ -597,6 +597,7 @@ const resources = {
|
||||||
"API.INVALID_VIRTUAL_METER_NAME": "Invalid virtual meter name",
|
"API.INVALID_VIRTUAL_METER_NAME": "Invalid virtual meter name",
|
||||||
"API.INVALID_WEB_MESSAGE_ID": "Invalid web message id",
|
"API.INVALID_WEB_MESSAGE_ID": "Invalid web message id",
|
||||||
"API.INVALID_WECHAT_MESSAGE_ID": "Invalid wechat message id",
|
"API.INVALID_WECHAT_MESSAGE_ID": "Invalid wechat message id",
|
||||||
|
"API.KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK": "Knowledge File Cannot be Removed from Disk",
|
||||||
"API.KNOWLEDGE_FILE_NOT_FOUND": "Knowledge file not found",
|
"API.KNOWLEDGE_FILE_NOT_FOUND": "Knowledge file not found",
|
||||||
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "Master meter does not belong to same energy category",
|
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "Master meter does not belong to same energy category",
|
||||||
"API.MASTER_METER_NOT_FOUND": "Master meter not found",
|
"API.MASTER_METER_NOT_FOUND": "Master meter not found",
|
||||||
|
@ -1346,6 +1347,7 @@ const resources = {
|
||||||
"API.INVALID_VIRTUAL_METER_NAME": "",
|
"API.INVALID_VIRTUAL_METER_NAME": "",
|
||||||
"API.INVALID_WEB_MESSAGE_ID": "",
|
"API.INVALID_WEB_MESSAGE_ID": "",
|
||||||
"API.INVALID_WECHAT_MESSAGE_ID": "",
|
"API.INVALID_WECHAT_MESSAGE_ID": "",
|
||||||
|
"API.KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK": "",
|
||||||
"API.KNOWLEDGE_FILE_NOT_FOUND": "",
|
"API.KNOWLEDGE_FILE_NOT_FOUND": "",
|
||||||
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "",
|
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "",
|
||||||
"API.MASTER_METER_NOT_FOUND": "",
|
"API.MASTER_METER_NOT_FOUND": "",
|
||||||
|
@ -2095,6 +2097,7 @@ const resources = {
|
||||||
"API.INVALID_VIRTUAL_METER_NAME": "",
|
"API.INVALID_VIRTUAL_METER_NAME": "",
|
||||||
"API.INVALID_WEB_MESSAGE_ID": "",
|
"API.INVALID_WEB_MESSAGE_ID": "",
|
||||||
"API.INVALID_WECHAT_MESSAGE_ID": "",
|
"API.INVALID_WECHAT_MESSAGE_ID": "",
|
||||||
|
"API.KNOWLEDGE_FILE_CANNOT_BE_REMOVED_FROM_DISK": "",
|
||||||
"API.KNOWLEDGE_FILE_NOT_FOUND": "",
|
"API.KNOWLEDGE_FILE_NOT_FOUND": "",
|
||||||
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "",
|
"API.MASTER_METER_DOES_NOT_BELONG_TO_SAME_ENERGY_CATEGORY": "",
|
||||||
"API.MASTER_METER_NOT_FOUND": "",
|
"API.MASTER_METER_NOT_FOUND": "",
|
||||||
|
|
Loading…
Reference in New Issue