mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Further fixes to tasks.py
This commit is contained in:
parent
96ef5e1bde
commit
563bfe9bf5
5
tasks.py
5
tasks.py
@ -6,6 +6,7 @@ from shutil import copyfile
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
def apps():
|
def apps():
|
||||||
"""
|
"""
|
||||||
@ -257,7 +258,7 @@ def export_records(c, filename='data.json'):
|
|||||||
|
|
||||||
if response not in ['y', 'yes']:
|
if response not in ['y', 'yes']:
|
||||||
print("Cancelled export operation")
|
print("Cancelled export operation")
|
||||||
return 0
|
sys.exit(1)
|
||||||
|
|
||||||
cmd = f'dumpdata --exclude contenttypes --exclude auth.permission --indent 2 --output {filename}'
|
cmd = f'dumpdata --exclude contenttypes --exclude auth.permission --indent 2 --output {filename}'
|
||||||
|
|
||||||
@ -275,7 +276,7 @@ def import_records(c, filename='data.json'):
|
|||||||
|
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
print(f"Error: File '{filename}' does not exist")
|
print(f"Error: File '{filename}' does not exist")
|
||||||
return -1
|
sys.exit(1)
|
||||||
|
|
||||||
print(f"Importing database records from '{filename}'")
|
print(f"Importing database records from '{filename}'")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user