summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-08-14 22:52:14 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-08-14 22:52:14 +0300
commit284e044a03caccab0d5dfa2cd1ac56949b80c20b (patch)
treefd8a96bf6b63bb10f829086d199cb16fc3412b1f /parsers
parentb093d00ff46477c2fc7042bfd19962098cf6002c (diff)
downloadtroggle-284e044a03caccab0d5dfa2cd1ac56949b80c20b.tar.gz
troggle-284e044a03caccab0d5dfa2cd1ac56949b80c20b.tar.bz2
troggle-284e044a03caccab0d5dfa2cd1ac56949b80c20b.zip
Fix wallets scan upload faults
Diffstat (limited to 'parsers')
-rw-r--r--parsers/drawings.py4
-rw-r--r--parsers/scans.py34
-rw-r--r--parsers/survex.py6
3 files changed, 25 insertions, 19 deletions
diff --git a/parsers/drawings.py b/parsers/drawings.py
index 1c5a1e8..4f52889 100644
--- a/parsers/drawings.py
+++ b/parsers/drawings.py
@@ -18,7 +18,7 @@ from troggle.core.utils import save_carefully, GetListDir
for tunnel and therion files
'''
-todo='''
+todo='''Rename functions more consistently between tunnel and therion variants
'''
def find_dwg_file(dwgfile, path):
@@ -104,7 +104,7 @@ def findwalletimage(therionfile, foundpath):
else:
message = f'! Scanned file {scanfilename} mentioned in "{therionfile.dwgpath}" is not actually found in {wallet.walletname}'
wurl = f'/survey_scans/{wallet.walletname}/'.replace("#",":")
- print(message)
+ # print(message)
DataIssue.objects.create(parser='Therion', message=message, url = wurl)
diff --git a/parsers/scans.py b/parsers/scans.py
index 6439549..400bd74 100644
--- a/parsers/scans.py
+++ b/parsers/scans.py
@@ -21,7 +21,7 @@ from troggle.core.views.scans import datewallet
'''
contentsjson = "contents.json"
-indexhtml = "walletindex.html"
+#indexhtml = "walletindex.html"
git = settings.GIT
# to do: create a 'low priority' field, so that any such wallet does not appear in summary reports
@@ -44,22 +44,22 @@ wallet_blank_json = {
"survex not required": False,
"website updated": False}
-wallet_blank_html = '''<html><body><H1>Wallet WALLET</H1>
-<p>List of trips: <a href="http://expo.survex.com/expedition/YEAR">expedition/YEAR</a>
-- troggle-processed .svx files and logbook entries on server</p>
-<p>Date: </p><p>People: Unknown,</p>
-<p>Cave <a href='http://expo.survex.com/caves/'>Guidebook description</a>
-- A description is indicated as being needed, so may need adding into this cave page.
-<p>Survex file: not identified yet
-<H2>Issues</H2>
-<p>The description needs writing</p>
-<p>The QMs needs writing</p><p>The website is marked as needing updating (using the guidebook description)</p>
-<p>Tunnel / Therion drawing files need drawing</p>
-<H2>Files</H2>
-<UL>
-</UL>
-</body></html>
-'''
+# wallet_blank_html = '''<html><body><H1>Wallet WALLET</H1>
+# <p>List of trips: <a href="http://expo.survex.com/expedition/YEAR">expedition/YEAR</a>
+# - troggle-processed .svx files and logbook entries on server</p>
+# <p>Date: </p><p>People: Unknown,</p>
+# <p>Cave <a href='http://expo.survex.com/caves/'>Guidebook description</a>
+# - A description is indicated as being needed, so may need adding into this cave page.
+# <p>Survex file: not identified yet
+# <H2>Issues</H2>
+# <p>The description needs writing</p>
+# <p>The QMs needs writing</p><p>The website is marked as needing updating (using the guidebook description)</p>
+# <p>Tunnel / Therion drawing files need drawing</p>
+# <H2>Files</H2>
+# <UL>
+# </UL>
+# </body></html>
+# '''
def CheckEmptyDate(wallet):
'''If date is not set, get it from a linked survex file.
diff --git a/parsers/survex.py b/parsers/survex.py
index d5ed15f..07f5799 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -1528,6 +1528,12 @@ def LoadSurvexBlocks():
survexblockroot = SurvexBlock(name=ROOTBLOCK, survexpath="", cave=None, survexfile=survexfileroot,
legsall=0, legslength=0.0)
# crashes here sometimes on MariaDB complaining that cave_id should not be null. But it should be.
+ #django.db.utils.IntegrityError: (1048, "Column 'cave_id' cannot be null")
+ # fix by restarting db on server
+ # sudo service mariadb stop
+ # sudo service mariadb start
+
+
survexblockroot.save()
print(' - Loading Survex Blocks...')