mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-17 08:37:26 +00:00
tidy up entranceSlug all now deleted
This commit is contained in:
@@ -10,7 +10,7 @@ from django.urls import NoReverseMatch
|
||||
|
||||
import troggle.settings as settings
|
||||
from troggle.core.forms import CaveAndEntranceFormSet, CaveForm, EntranceForm, EntranceLetterForm
|
||||
from troggle.core.models.caves import Cave, CaveAndEntrance, Entrance, GetCaveLookup # EntranceSlug,
|
||||
from troggle.core.models.caves import Cave, CaveAndEntrance, Entrance, GetCaveLookup
|
||||
from troggle.core.models.logbooks import CaveSlug, QM
|
||||
from troggle.core.utils import write_and_commit
|
||||
from troggle.core.views import expo
|
||||
@@ -407,8 +407,10 @@ def edit_cave(request, path="", slug=None):
|
||||
def edit_entrance(request, path="", caveslug=None, slug=None):
|
||||
"""This is the form that edits the entrance data for a single entrance and writes out
|
||||
an XML file in the :expoweb: repo folder
|
||||
|
||||
The format for the file being saved is in templates/dataformat/entrance.xml
|
||||
Warning. This uses Django deep magic.
|
||||
|
||||
Warning. This uses Django deep magic for multiple forms and the CaveAndEntrance class.
|
||||
|
||||
It does save the data into into the database directly, not by parsing the file.
|
||||
"""
|
||||
@@ -419,7 +421,6 @@ def edit_entrance(request, path="", caveslug=None, slug=None):
|
||||
return render(request, "errors/badslug.html", {"badslug": f"{slug} {caveslug} - from edit_entrance()"})
|
||||
|
||||
if slug:
|
||||
# entrance = Entrance.objects.get(entranceslug__slug=slug)
|
||||
caveAndEntrance = CaveAndEntrance.objects.get(entrance=entrance, cave=cave)
|
||||
entlettereditable = False
|
||||
else:
|
||||
@@ -441,9 +442,6 @@ def edit_entrance(request, path="", caveslug=None, slug=None):
|
||||
entrance.cached_primary_slug = slugname
|
||||
entrance.filename = slugname + ".html"
|
||||
entrance.save()
|
||||
# if slug is None:
|
||||
# es = EntranceSlug(entrance=entrance, slug=slugname, primary=True)
|
||||
# es.save()
|
||||
entrance_file = entrance.file_output()
|
||||
cave_file = cave.file_output()
|
||||
write_and_commit([entrance_file, cave_file], f"Online edit of {cave}{entletter}")
|
||||
@@ -485,29 +483,12 @@ def ent(request, cave_id, ent_letter):
|
||||
|
||||
def cave_debug(request):
|
||||
ents = Entrance.objects.all().order_by('id')
|
||||
#slugs = self.entranceslug_set.filter()
|
||||
return render(
|
||||
request,
|
||||
"cave_debug.html",
|
||||
{"ents": ents},
|
||||
)
|
||||
|
||||
# def entranceSlug(request, slug):
|
||||
# '''This seems to be a fossil, but I am not sure...
|
||||
# '''
|
||||
# entrance = Entrance.objects.get(entranceslug__slug = slug)
|
||||
# if entrance.non_public and not request.user.is_authenticated:
|
||||
# return render(request,'nonpublic.html', {'instance': entrance})
|
||||
# else:
|
||||
# return render(request,'entranceslug.html', {'entrance': entrance})
|
||||
|
||||
# def surveyindex(request):
|
||||
# '''The template does not exist, there is no URL which calls this, so it is a fossil
|
||||
# '''
|
||||
# surveys=Survey.objects.all()
|
||||
# expeditions=Expedition.objects.order_by("-year")
|
||||
# return render(request,'survey.html',locals())
|
||||
|
||||
|
||||
def get_entrances(request, caveslug):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user