From 9dc1853e10206fb99e3a9761d692f537bdda8878 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 29 Dec 2022 13:56:09 +0000 Subject: cope with bad wallet name --- core/views/uploads.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'core/views/uploads.py') diff --git a/core/views/uploads.py b/core/views/uploads.py index 6eaadc6..648e340 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -676,12 +676,15 @@ def scanupload(request, path=None): checked[f] = "checked" survexsize = str(min(len(str(waldata["survex file"])), 46)) - - thiswallet = Wallet.objects.get(walletname=wallet) - caveifywallet(thiswallet) - thiswallet.ticks = thiswallet.get_ticks() # the complaints in colour form - #fixsurvextick(thiswallet, thiswallet.ticks) - print(thiswallet) + + try: + thiswallet = Wallet.objects.get(walletname=wallet) + caveifywallet(thiswallet) + thiswallet.ticks = thiswallet.get_ticks() # the complaints in colour form + #fixsurvextick(thiswallet, thiswallet.ticks) + print(thiswallet) + except: + thiswallet = None context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty, 'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles, 'checked': checked, -- cgit v1.2.3