summaryrefslogtreecommitdiffstats
path: root/parsers/drawings.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2021-11-06 23:37:31 +0200
committerPhilip Sargent <philip.sargent@gmail.com>2021-11-06 23:37:31 +0200
commitb72706356d20883832a1f3b513ad8a998a17d1f0 (patch)
tree7d3b2da6441f2dbbde28e2e0c8e0a54f84cac36e /parsers/drawings.py
parent73ffb509f79a6f623ba9c82be17c907cbcdf7afb (diff)
downloadtroggle-b72706356d20883832a1f3b513ad8a998a17d1f0.tar.gz
troggle-b72706356d20883832a1f3b513ad8a998a17d1f0.tar.bz2
troggle-b72706356d20883832a1f3b513ad8a998a17d1f0.zip
fixed mistaken DataIssue report
Diffstat (limited to 'parsers/drawings.py')
-rw-r--r--parsers/drawings.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/parsers/drawings.py b/parsers/drawings.py
index 8c45aae..d0a2257 100644
--- a/parsers/drawings.py
+++ b/parsers/drawings.py
@@ -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()