mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 03:47:17 +00:00
bugfix i hope
This commit is contained in:
@@ -648,7 +648,7 @@ def edit_entrance(request, path="", caveslug=None, entslug=None):
|
|||||||
if slug in gcl:
|
if slug in gcl:
|
||||||
c = gcl[slug]
|
c = gcl[slug]
|
||||||
else:
|
else:
|
||||||
c = Cave.objects.get(cave=c)
|
c = Cave.objects.get(slug=slug)
|
||||||
nce = CaveAndEntrance.objects.filter(cave=c, entrance=e).count()
|
nce = CaveAndEntrance.objects.filter(cave=c, entrance=e).count()
|
||||||
if nce == 0 :
|
if nce == 0 :
|
||||||
return slugname, letter
|
return slugname, letter
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ def dummy_entrance(k, slug, msg="DUMMY"):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def set_dummy_entrance(id, slug, cave, msg="DUMMY"):
|
def report_absent_entrace(id, slug, cave, msg="DUMMY"):
|
||||||
"""Called only when reading the cave and entrance html files
|
"""Called only when reading the cave and entrance html files
|
||||||
|
|
||||||
Called when the Entrance field in a cave_data file is either missing or
|
Called when the Entrance field in a cave_data file is either missing or
|
||||||
@@ -88,6 +88,7 @@ def set_dummy_entrance(id, slug, cave, msg="DUMMY"):
|
|||||||
"""
|
"""
|
||||||
global entrances_xslug
|
global entrances_xslug
|
||||||
message = f" - Note: Missing Entrance for entrance '{id}' on cave '{cave}' - Is this a problem?"
|
message = f" - Note: Missing Entrance for entrance '{id}' on cave '{cave}' - Is this a problem?"
|
||||||
|
print(message)
|
||||||
DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}")
|
DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}")
|
||||||
|
|
||||||
def add_cave_to_pending_list(id, wallet, message):
|
def add_cave_to_pending_list(id, wallet, message):
|
||||||
@@ -671,7 +672,7 @@ def read_cave(filename, mvf=None, cave=None):
|
|||||||
|
|
||||||
if len(entrances) == 1 and not eslug: # may be empty: <entranceslug></entranceslug>
|
if len(entrances) == 1 and not eslug: # may be empty: <entranceslug></entranceslug>
|
||||||
msg="DUMMY: no entrance slug read from file, so assume textually same as cave slug"
|
msg="DUMMY: no entrance slug read from file, so assume textually same as cave slug"
|
||||||
set_dummy_entrance(slug[5:], slug, c, msg=msg)
|
report_absent_entrace(slug[5:], slug, c, msg=msg)
|
||||||
print(f"! {msg}\n- {slug} {c}")
|
print(f"! {msg}\n- {slug} {c}")
|
||||||
else:
|
else:
|
||||||
if eslug in entrances_xslug:
|
if eslug in entrances_xslug:
|
||||||
@@ -919,7 +920,7 @@ def read_cave(filename, mvf=None, cave=None):
|
|||||||
#do_entrances()
|
#do_entrances()
|
||||||
if not entrances or len(entrances) < 1:
|
if not entrances or len(entrances) < 1:
|
||||||
# missing entrance link in cave_data/1623-* .html file
|
# missing entrance link in cave_data/1623-* .html file
|
||||||
set_dummy_entrance(slug[5:], slug, cave, msg="DUMMY: no entrances")
|
report_absent_entrace(slug[5:], slug, cave, msg="DUMMY: no entrances")
|
||||||
else:
|
else:
|
||||||
do_entrances()
|
do_entrances()
|
||||||
if manual_edit:
|
if manual_edit:
|
||||||
|
|||||||
Reference in New Issue
Block a user