mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 11:57:07 +00:00
detecting empty wallets where we only have JSON and no files
This commit is contained in:
@@ -110,11 +110,25 @@ def load_all_scans():
|
||||
CheckEmptyPeople(wallet)
|
||||
wallet.save()
|
||||
LoadListScansFile(wallet)
|
||||
|
||||
|
||||
|
||||
|
||||
else:
|
||||
# but We should load all the scans, even for nonstandard names.
|
||||
print(f'\n - IGNORE {walletname} - {fpath}')
|
||||
|
||||
|
||||
# but we also need to check if JSON exists, even if there are no uploaded scan files
|
||||
contents_path = Path(settings.DRAWINGS_DATA, "walletjson")
|
||||
for yeardir in contents_path.iterdir():
|
||||
if yeardir.is_dir():
|
||||
for walletpath in yeardir.iterdir():
|
||||
if Path(walletpath, contentsjson).is_file():
|
||||
walletname = walletpath.name
|
||||
wallet, created = Wallet.objects.update_or_create(walletname=walletname)
|
||||
if created:
|
||||
print(f"\n{walletname} created: only JSON, no actual uploaded scan files.", end=' ')
|
||||
CheckEmptyDate(wallet)
|
||||
CheckEmptyPeople(wallet)
|
||||
wallet.save()
|
||||
|
||||
|
||||
print("", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user