From 284e044a03caccab0d5dfa2cd1ac56949b80c20b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 14 Aug 2022 22:52:14 +0300 Subject: Fix wallets scan upload faults --- parsers/drawings.py | 4 ++-- parsers/scans.py | 34 +++++++++++++++++----------------- parsers/survex.py | 6 ++++++ 3 files changed, 25 insertions(+), 19 deletions(-) (limited to 'parsers') 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 = '''

Wallet WALLET

-

List of trips: expedition/YEAR -- troggle-processed .svx files and logbook entries on server

-

Date:

People: Unknown,

-

Cave Guidebook description -- A description is indicated as being needed, so may need adding into this cave page. -

Survex file: not identified yet -

Issues

-

The description needs writing

-

The QMs needs writing

The website is marked as needing updating (using the guidebook description)

-

Tunnel / Therion drawing files need drawing

-

Files

- - -''' +# wallet_blank_html = '''

Wallet WALLET

+#

List of trips: expedition/YEAR +# - troggle-processed .svx files and logbook entries on server

+#

Date:

People: Unknown,

+#

Cave Guidebook description +# - A description is indicated as being needed, so may need adding into this cave page. +#

Survex file: not identified yet +#

Issues

+#

The description needs writing

+#

The QMs needs writing

The website is marked as needing updating (using the guidebook description)

+#

Tunnel / Therion drawing files need drawing

+#

Files

+# +# +# ''' 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...') -- cgit v1.2.3