diff --git a/core/models/wallets.py b/core/models/wallets.py index 4077961..7dacc7d 100644 --- a/core/models/wallets.py +++ b/core/models/wallets.py @@ -155,9 +155,11 @@ class Wallet(models.Model): wname = fp.name wyear = fp.parent.name - if not int(wyear): - message = f"! Subfolder detected?:\n {wyear=} (should be eg. '2023')\n {wname=} \n {self.fpath=}" - print(message) + try: + y = int(wyear) + except: + message = f"! Subfolder detected?:\n {wyear=} (should be eg. '2023')\n {wname=} \n {self.fpath=}" + print(message) wurl = self.get_url() if len(wyear) != 4 or len(wname) !=6: