2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-01-19 01:12:32 +00:00

fixed mistaken DataIssue report

This commit is contained in:
Philip Sargent 2021-11-06 23:37:31 +02:00
parent 73ffb509f7
commit b72706356d

View File

@ -54,7 +54,10 @@ def find_dwg_file(dwgfile, path):
scansfilel = wallet.singlescan_set.filter(name=mscansdir.group(2))
if len(scansfilel):
if len(scansfilel) > 1:
message = "! More than one image FILENAME matches filter query. [{}]: {} {} {} {}".format(scansfilel[0], mscansdir.group(1), mscansdir.group(2), dwgfile.dwgpath, path)
plist =[]
for sf in scansfilel:
plist.append(sf.ffile)
message = "! More than one image FILENAME matches filter query. [{}]: {} {} {} {} {}".format(scansfilel[0], mscansdir.group(1), mscansdir.group(2), dwgfile.dwgpath, path, plist)
print(message)
DataIssue.objects.create(parser='Tunnel', message=message)
scansfile = scansfilel[0]
@ -68,11 +71,15 @@ def find_dwg_file(dwgfile, path):
name = os.path.split(path)[1]
rdwgfilel = DrawingFile.objects.filter(dwgname=name)
if len(rdwgfilel):
message = "! Two paths with same name [{}]: {}".format(path, name)
print(message)
DataIssue.objects.create(parser='Tunnel', message=message)
rdwgfile = rdwgfilel[0]
dwgfile.dwgcontains.add(rdwgfile)
if len(rdwgfilel) > 1:
plist =[]
for df in rdwgfilel:
plist.append(df.dwgname)
message = f"! {len(rdwgfilel)} paths found with same name '{path}' {plist}"
print(message)
DataIssue.objects.create(parser='Tunnel', message=message)
rdwgfile = rdwgfilel[0]
dwgfile.dwgcontains.add(rdwgfile)
dwgfile.save()