2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00
This commit is contained in:
Philip Sargent 2023-03-22 15:18:16 +00:00
parent ad48851118
commit 5f46d8fdc5
2 changed files with 6 additions and 3 deletions

View File

@ -272,7 +272,7 @@ class PageTests(TestCase):
for ph in [ for ph in [
r'a href="/expofiles/documents/bier-tent-instructions.pdf">bier-tent-instructions.pdf', r'a href="/expofiles/documents/bier-tent-instructions.pdf">bier-tent-instructions.pdf',
r'a href="/expofiles/documents/boc.pdf">boc.pdf', r'a href="/expofiles/documents/boc.pdf">boc.pdf',
r'a href="/expofiles/documents/bierbook">/bierbook', r'a href="/expofiles/documents/idiots-guide-expo-git.pdf"',
]: ]:
phmatch = re.search(ph, content) phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'") self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@ -343,7 +343,7 @@ class PageTests(TestCase):
def test_page_expofile_document_rope_pdf(self): def test_page_expofile_document_rope_pdf(self):
# Flat file tests. # Flat file tests.
response = self.client.get("/expofiles/documents/rope-age-agm-2019.pdf") response = self.client.get("/expofiles/documents/ropes/rope-age-agm-2019.pdf")
if response.status_code != HTTPStatus.OK: if response.status_code != HTTPStatus.OK:
self.assertEqual(response.status_code, HTTPStatus.FOUND) self.assertEqual(response.status_code, HTTPStatus.FOUND)
if response.status_code != HTTPStatus.FOUND: if response.status_code != HTTPStatus.FOUND:

View File

@ -20,6 +20,7 @@ from troggle.core.models.survex import SurvexBlock, SurvexFile, SurvexPersonRole
from troggle.core.models.troggle import DataIssue, Expedition from troggle.core.models.troggle import DataIssue, Expedition
from troggle.core.models.wallets import Wallet, YEAR_RANGE from troggle.core.models.wallets import Wallet, YEAR_RANGE
from troggle.core.views.auth import login_required_if_public
from troggle.core.views.caves import getCave from troggle.core.views.caves import getCave
from troggle.core.views.scans import caveifywallet, oldwallet from troggle.core.views.scans import caveifywallet, oldwallet
from troggle.core.views.uploads import FilesForm from troggle.core.views.uploads import FilesForm
@ -39,7 +40,7 @@ todo = """
- Refactor walletedit() as it contains all the wallets 'complaints' code from the pre-2022 - Refactor walletedit() as it contains all the wallets 'complaints' code from the pre-2022
script 'wallets.py' script 'wallets.py'
- Need to validate uploaded file as being a valid image file, not a dubious script or hack - We should validate uploaded file as being a valid image file, not a dubious script or hack?
""" """
WALLET_BLANK_JSON = { WALLET_BLANK_JSON = {
"cave": "", "cave": "",
@ -851,10 +852,12 @@ def walletedit(request, path=None):
else: else:
svxothers = None svxothers = None
trips = None trips = None
wallets = None
else: else:
svxothers = None svxothers = None
trips = None trips = None
wallets = None
# Survex and survex complaints, comes from json file on disc, not as pre-populated as above # Survex and survex complaints, comes from json file on disc, not as pre-populated as above
complaints, caveobject = get_complaints([], waldata, svxfiles, files, wallet, wurl) complaints, caveobject = get_complaints([], waldata, svxfiles, files, wallet, wurl)