Further fixes to tasks.py

This commit is contained in:
Oliver Walters 2020-11-12 16:10:00 +11:00
parent 96ef5e1bde
commit 563bfe9bf5

View File

@ -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}'")