From 7f335e082cbb40b869ce4705dec30c11a2e9f16a Mon Sep 17 00:00:00 2001 From: Philip Sargent <philip.sargent@klebos.com> Date: Sun, 7 Aug 2022 23:26:31 +0300 Subject: [PATCH] prevent error message repetition in DataIssues --- core/views/uploads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/views/uploads.py b/core/views/uploads.py index 9bfbc18..9bb37cd 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -128,11 +128,11 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl): if svx !="": svxfiles.append(svx) if not (Path(settings.SURVEX_DATA) / svx).is_file(): - file_complaint = f"{wallet} Incorrect survex file name in wallet data: {svx} not found in LOSER repo" + file_complaint = f"{wallet} Incorrect survex file name in {wallet} wallet data. {svx} was not found in LOSER repo" complaints.append(file_complaint) message = f"! {file_complaint}" print(message) - DataIssue.objects.create(parser='scans', message=message, url=wurl) # set URL to this wallet folder + DataIssue.objects.update_or_create(parser='scans', message=message, url=wurl) # set URL to this wallet folder if waldata["survex not required"] and waldata["survex file"] != "": survex_complaint = "Survex is stated as not required and yet there is a survex file!"