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

properly turn off automagic entrance creation

This commit is contained in:
Philip Sargent 2023-07-26 01:23:49 +03:00
parent fab7adf079
commit 1f656b2101

View File

@ -85,23 +85,18 @@ def set_dummy_entrance(id, slug, cave, msg="DUMMY"):
so
"""
global entrances_xslug
message = f" - Note: Missing Entrance for entrance '{id}' on cave '{cave}'"
message = f" - Note: Missing Entrance for entrance '{id}' on cave '{cave}' - Is this a problem?"
DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}")
try:
# I am not sure if we want entrances automagically created.
# Therefore I have commented it out. MJG
# Automagic restored, as it creates a load of error message in the DataIssue log. 2023-07-25
# pending doing this properly, ie. properly creating an XML file for each of these pending caves.
entrance = dummy_entrance(id, slug, msg="DUMMY")
entrances_xslug[slug] = entrance
CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance)
pass
except:
message = f' ! Entrance Dummy setting failure, slug:"{slug}" cave id :"{id}" '
DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}")
print(message)
# try:
# entrance = dummy_entrance(id, slug, msg="DUMMY")
# entrances_xslug[slug] = entrance
# CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance)
# pass
# except:
# message = f' ! Entrance Dummy setting failure, slug:"{slug}" cave id :"{id}" '
# DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}")
# print(message)
def make_areas():
print(" - Creating Areas 1623, 1624, 1627 and 1626")
@ -298,7 +293,9 @@ def do_pending_cave(k, caveid, url, area):
print(message)
try:
set_dummy_entrance(k, slug, cave, msg="PENDING")
# troggle is more robust against missing entrances now, not needed.
# set_dummy_entrance(k, slug, cave, msg="PENDING")
pass
except:
message = f" ! {k:11s} PENDING entrance + cave UNION create failure '{cave}' [{slug}] {k}"
# message = f" ! {k:11s} PENDING entrance + cave UNION create failure '{cave}' [{ent}]"
@ -726,7 +723,7 @@ def readcaves():
DataIssue.objects.filter(parser="areas").delete()
DataIssue.objects.filter(parser="caves").delete()
DataIssue.objects.filter(parser="caves ok").delete()
DataIssue.objects.filter(parser="entrances").delete()
#DataIssue.objects.filter(parser="entrances").delete()
with transaction.atomic():
area = get_area("1623")
@ -766,7 +763,7 @@ def readcaves():
try:
do_pending_cave(k, number, url, area)
except:
message = f" ! Error. Cannot create pending cave and entrance, pending-id:{k} in area {areanum}"
message = f" ! Error. Cannot create pending cave, pending-id:{k} in area {areanum}"
DataIssue.objects.create(parser="caves", message=message)
print(message)
raise