2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 07:07:18 +00:00

partially fixing results from create entrance bug (not fixed)

This commit is contained in:
2025-07-23 22:16:23 +02:00
parent 1ca7fd5a2c
commit bb74b95aaf

View File

@@ -855,6 +855,7 @@ def read_cave(filename, mvf=None, cave=None):
manual_edit = False
# The Cave object should already have been created when reading the entrance_data file
# But what if there is no Entrance (yet) ? Then the cave won't exist.
caves = Cave.objects.filter(filename=filename)
if len(caves) ==1:
cave = caves[0]
@@ -864,7 +865,11 @@ def read_cave(filename, mvf=None, cave=None):
cave = c[0]
else:
print(f" * Cannot find single Cave object for cave_data/{filename} from entrance_data file. {len(caves)} found")
return False
message = f' * {slug:12} Cannot find single Cave object for cave_data/{filename} from entrance_data file. {len(caves)} found. "'
DataIssue.objects.create(parser="caves", message=message, url=f"/{slug[0:4]}/{slug}_cave_edit/")
print(message)
cave = make_cave(slug)
# return False
# From here on the code applies to both edited and newly-imported caves (mostly!)