2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

prevent error message repetition in DataIssues

This commit is contained in:
Philip Sargent 2022-08-07 23:26:31 +03:00
parent 9220dbf2e6
commit 7f335e082c

View File

@ -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!"