From f33c6cc0570fc409f2928b5cbda2f79dbcf0b99f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 6 Aug 2022 22:23:39 +0300 Subject: [PATCH] bugfix in new wallet --- core/models/survex.py | 4 +++- core/views/uploads.py | 4 ++-- parsers/scans.py | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/models/survex.py b/core/models/survex.py index de65611..7e6358c 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -254,9 +254,11 @@ class Wallet(models.Model): def get_ticks(self): + ticks = {} waldata = self.get_json() if not waldata: - return {} + ticks["W"] = "black" + return ticks ticks = {} # Initially, are there any required survex files present ? diff --git a/core/views/uploads.py b/core/views/uploads.py index a8908d0..e46ddba 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -248,8 +248,8 @@ def scanupload(request, path=None): wurl = f"/scanupload/{wallet}".replace('#', ':') wallet = wallet.replace(':','#') dirpath = Path(settings.SCANS_ROOT, year, wallet) - contents_path = dirpath / contentsjson - walletdata = dirpath / contentsjson + #contents_path = dirpath / contentsjson + contents_path = Path(settings.DRAWINGS_DATA, "walletjson") / year / wallet / contentsjson form = FilesForm() diff --git a/parsers/scans.py b/parsers/scans.py index 37578cb..4e6d495 100644 --- a/parsers/scans.py +++ b/parsers/scans.py @@ -102,9 +102,12 @@ def LoadListScansFile(wallet): c = 0 def CopyWalletData(wallet): '''Copies all the contents.json to a parallel set of folders in the drawings repo - refreshes everything during a ful import, but it shoudl all be up to date as every time + refreshes everything during a ful import, but it should all be up to date as every time wallet data gets saved it should also be copied across and committed. ''' + # not needed now the drawinsg repo is the master + return + year = wallet.walletname[0:4] destfolder = Path(settings.DRAWINGS_DATA,'walletjson', year, wallet.walletname) destjson = destfolder / contentsjson