diff options
Diffstat (limited to 'core/models')
-rw-r--r-- | core/models/wallets.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/models/wallets.py b/core/models/wallets.py index 931a1fc..551e3e1 100644 --- a/core/models/wallets.py +++ b/core/models/wallets.py @@ -32,7 +32,8 @@ class Wallet(models.Model): return urljoin(settings.URL_ROOT, reverse("singlewallet", kwargs={"path": re.sub("#", "%23", self.walletname)})) def get_json(self): - """Read the JSON file for the wallet and do stuff""" + """Read the JSON file for the wallet and do stuff + Do it every time it is queried, to be sure the result is fresh""" # jsonfile = Path(self.fpath, 'contents.json') # Get from git repo instead @@ -102,9 +103,8 @@ class Wallet(models.Model): """Reads all the JSON data just to get the JSON date.""" if self.walletdate: return self.walletdate - if not self.get_json(): + if not (jsondata := self.get_json()): # WALRUS return None - jsondata = self.get_json() # use walrus operator? datestr = jsondata["date"] if not datestr: @@ -259,7 +259,7 @@ class Wallet(models.Model): ticks["N"] = "red" else: ticks["N"] = "green" - print(f"{self.walletname} {ticks['N'].upper()} {notes_scanned=} {notes_required=} {waldata['notes not required']=}") + # print(f"{self.walletname} {ticks['N'].upper()} {notes_scanned=} {notes_required=} {waldata['notes not required']=}") # Plan drawing required plan_scanned = reduce(operator.or_, [f.startswith("plan") for f in files], False) |