From 5007393536bd23c19d16b41f9ef0806715ca111a Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 23 Jul 2022 20:05:58 +0300 Subject: better error handling --- core/views/uploads.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'core/views/uploads.py') diff --git a/core/views/uploads.py b/core/views/uploads.py index 091534a..b275d2a 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -211,9 +211,14 @@ def scanupload(request, path=None): wallet = "2022#01" # improve this later year = wallet[:4] - if int(year) <= 1998: - #print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') + try: + if int(year) <= 1998: + #print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') + return(oldwallet(request, path)) + except: + # if nonumeric wallet name for example return(oldwallet(request, path)) + if str(wallet).lower().endswith('indexpages'): # print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') -- cgit v1.2.3