mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-01-19 09:22:32 +00:00
fixed mistaken DataIssue report
This commit is contained in:
parent
73ffb509f7
commit
b72706356d
@ -54,7 +54,10 @@ def find_dwg_file(dwgfile, path):
|
|||||||
scansfilel = wallet.singlescan_set.filter(name=mscansdir.group(2))
|
scansfilel = wallet.singlescan_set.filter(name=mscansdir.group(2))
|
||||||
if len(scansfilel):
|
if len(scansfilel):
|
||||||
if len(scansfilel) > 1:
|
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)
|
print(message)
|
||||||
DataIssue.objects.create(parser='Tunnel', message=message)
|
DataIssue.objects.create(parser='Tunnel', message=message)
|
||||||
scansfile = scansfilel[0]
|
scansfile = scansfilel[0]
|
||||||
@ -68,11 +71,15 @@ def find_dwg_file(dwgfile, path):
|
|||||||
name = os.path.split(path)[1]
|
name = os.path.split(path)[1]
|
||||||
rdwgfilel = DrawingFile.objects.filter(dwgname=name)
|
rdwgfilel = DrawingFile.objects.filter(dwgname=name)
|
||||||
if len(rdwgfilel):
|
if len(rdwgfilel):
|
||||||
message = "! Two paths with same name [{}]: {}".format(path, name)
|
if len(rdwgfilel) > 1:
|
||||||
print(message)
|
plist =[]
|
||||||
DataIssue.objects.create(parser='Tunnel', message=message)
|
for df in rdwgfilel:
|
||||||
rdwgfile = rdwgfilel[0]
|
plist.append(df.dwgname)
|
||||||
dwgfile.dwgcontains.add(rdwgfile)
|
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()
|
dwgfile.save()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user