diff options
author | Martin Green <martin.speleo@gmail.com> | 2022-06-28 00:24:57 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2022-06-28 00:24:57 +0100 |
commit | dbe6d10fff393661002fb576dacb8223af8a5899 (patch) | |
tree | 0b032bbe2a6949a22a24ecdc896e0c286086958d /core/views/caves.py | |
parent | 2af88353f3ea487a1e129783db49ad71d3bc3410 (diff) | |
download | troggle-dbe6d10fff393661002fb576dacb8223af8a5899.tar.gz troggle-dbe6d10fff393661002fb576dacb8223af8a5899.tar.bz2 troggle-dbe6d10fff393661002fb576dacb8223af8a5899.zip |
Revert "Added some test pages showing different ways pages could be edited. This probably wants removing soon"
This reverts commit 2af88353f3ea487a1e129783db49ad71d3bc3410.
Diffstat (limited to 'core/views/caves.py')
-rw-r--r-- | core/views/caves.py | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/core/views/caves.py b/core/views/caves.py index bbc2750..8df801b 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -18,7 +18,7 @@ import troggle.settings as settings from troggle.core.views import expo from troggle.core.models.troggle import Expedition, DataIssue from troggle.core.models.caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation, GetCaveLookup -from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, EntranceForm, EntranceLetterForm, CaveFormCodeMirrorPreview, CaveFormTextArea, CaveFormTinyMCE +from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, EntranceForm, EntranceLetterForm from .auth import login_required_if_public '''Manages the complex procedures to assemble a cave description out of the compnoents @@ -297,42 +297,6 @@ def caveEntrance(request, slug): else: return render(request,'cave_entrances.html', {'cave': cave}) -def test_edit_cave(request, editor = "codemirror"): - '''This is the form that edits all the cave data and writes out an XML file in the :expoweb: repo folder - The format for the file being saved is in templates/dataformat/cave.xml - - It does save the data into into the database directly, not by parsing the file. - It does NOT yet commit to the git repoSaving is not allowed - ''' - form_type = {"codemirror": CaveForm, "codemirrorpreview": CaveFormCodeMirrorPreview, "textarea": CaveFormTextArea, "tinymce": CaveFormTinyMCE}[editor] - - message = "" - try: - cave = Cave.objects.get(caveslug__slug = "1623-264") - except: - return render(request,'errors/badslug.html') - if request.POST: - form = form_type(request.POST, instance=cave) - ceFormSet = CaveAndEntranceFormSet(request.POST) - #versionControlForm = VersionControlCommentForm(request.POST) - if form.is_valid() and ceFormSet.is_valid(): - pass - else: - message = f'! POST data is INVALID {cave}' - print(message) - else: - form = form_type(instance=cave) - ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all()) - #versionControlForm = VersionControlCommentForm() - - return render(request, - 'editcave.html', - {'form': form, 'cave': cave, 'message': message, - 'caveAndEntranceFormSet': ceFormSet, - 'editor': editor, - #'versionControlForm': versionControlForm - }) - @login_required_if_public def edit_cave(request, slug=None): '''This is the form that edits all the cave data and writes out an XML file in the :expoweb: repo folder @@ -341,7 +305,6 @@ def edit_cave(request, slug=None): It does save the data into into the database directly, not by parsing the file. It does NOT yet commit to the git repo ''' - message = "" if slug is not None: try: |