From 941100a8a3923f3c2831190f3a5fa2a81c9cd7e7 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Sun, 30 Apr 2023 19:03:09 +0100 Subject: [PATCH] Previously if a cave was found without an entrance an entrance was added to the database. However as this was not also added as a file, the new entrance could not be edited via the web interface. Without an entrance being made, they can still be added. --- parsers/caves.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parsers/caves.py b/parsers/caves.py index 97d3b0a..fbe9788 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -75,8 +75,10 @@ def set_dummy_entrance(id, slug, cave, msg="DUMMY"): try: entrance = dummy_entrance(id, slug, msg="DUMMY") entrances_xslug[slug] = entrance - CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance) - message = f" - Note: Dummy Entrance successfully set for entrance {id} on cave {cave}" + #Note the below line, just creates a dastabase entry and not a file, this then breaks entrance editing by the website. I am not sure if we want entrances automagically created. Therefore I have commented it out. MJG + #CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance) + #message = f" - Note: Dummy Entrance successfully set for entrance {id} on cave {cave}" + message = f" - Note: Missing Entrance for entrance {id} on cave {cave}" DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}") # print(message) except: