diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-09-02 17:49:37 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-09-02 17:49:37 +0300 |
commit | 1a8bc17f806d88b06aeabc28c11a6da199216fe2 (patch) | |
tree | f02f5038db4b02d78cf5fbf09bea91bb3a287966 /core | |
parent | c9729c046ccccfd5e858f1fe8fbf24619d156e30 (diff) | |
download | troggle-1a8bc17f806d88b06aeabc28c11a6da199216fe2.tar.gz troggle-1a8bc17f806d88b06aeabc28c11a6da199216fe2.tar.bz2 troggle-1a8bc17f806d88b06aeabc28c11a6da199216fe2.zip |
Fixed parsers
Diffstat (limited to 'core')
-rw-r--r-- | core/utils.py | 4 | ||||
-rw-r--r-- | core/views/auth.py | 3 | ||||
-rw-r--r-- | core/views/uploads.py | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/core/utils.py b/core/utils.py index 2aba924..6f07df9 100644 --- a/core/utils.py +++ b/core/utils.py @@ -69,8 +69,8 @@ def alphabet_suffix(n): if not alphabet: alphabet = list(string.ascii_lowercase) - if n < len(alphabet): - suffix = alphabet[n] + if n < len(alphabet) and n > 0: + suffix = alphabet[n-1] else: suffix = "_X_" + random.choice(string.ascii_lowercase) + random.choice(string.ascii_lowercase) return suffix diff --git a/core/views/auth.py b/core/views/auth.py index c4e78de..63cca2b 100644 --- a/core/views/auth.py +++ b/core/views/auth.py @@ -4,6 +4,7 @@ from django.contrib.auth import authenticate from django.contrib.auth import forms as auth_forms from django.contrib.auth import login, logout from django.contrib.auth.decorators import login_required +from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render from django.utils.http import url_has_allowed_host_and_scheme @@ -22,7 +23,7 @@ class login_required_if_public(object): def __call__(self, *args, **kwargs): return self.f(*args, **kwargs) - + # This is copied from CUYC.cuy.website.view.auth # If we want to do the whole online-email thing, we would also need to copy across the code in these diff --git a/core/views/uploads.py b/core/views/uploads.py index bc441f2..8a9c734 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -8,6 +8,7 @@ from django.shortcuts import render, redirect import settings +from troggle.core.models.caves import GetCaveLookup from troggle.core.models.logbooks import LogbookEntry, writelogbook, PersonLogEntry from troggle.core.models.survex import DrawingFile from troggle.core.models.troggle import DataIssue, Expedition, PersonExpedition @@ -340,7 +341,7 @@ def logbookedit(request, year=None, slug=None): "textrows": rows, }, ) - else: # no slug + else: # no slug or bad slug for an lbe which does not exist # NEW logbook entry return render( request, |