Loading of Test data fails due to unique primary key constraint in Allowance (#613)
* Ignore Pycharm IDE directory * init will get executed even if there are no tables, hence migrations cannot be applies at the first step * Separate loanaccount test data load because primary key conflicts due to post_save signal * Avoid multiple DB save calls
This commit is contained in:
@@ -4,14 +4,17 @@ import atexit
|
||||
def shutdown_function():
|
||||
from horilla_backup.models import GoogleDriveBackup, LocalBackup
|
||||
|
||||
if GoogleDriveBackup.objects.exists():
|
||||
google_drive_backup = GoogleDriveBackup.objects.first()
|
||||
google_drive_backup.active = False
|
||||
google_drive_backup.save()
|
||||
if LocalBackup.objects.exists():
|
||||
local_backup = LocalBackup.objects.first()
|
||||
local_backup.active = False
|
||||
local_backup.save()
|
||||
try:
|
||||
if GoogleDriveBackup.objects.exists():
|
||||
google_drive_backup = GoogleDriveBackup.objects.first()
|
||||
google_drive_backup.active = False
|
||||
google_drive_backup.save()
|
||||
if LocalBackup.objects.exists():
|
||||
local_backup = LocalBackup.objects.first()
|
||||
local_backup.active = False
|
||||
local_backup.save()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user