summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-07-06 17:35:08 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-07-06 17:35:08 +0300
commitd3572e18c34c20c661eb61c7f8c46358f7223d37 (patch)
tree5bfddf3a5271e2b44313ef5866f7dee36c344b57 /parsers/survex.py
parent7dc3cc3b91e0c8dff87ccc09a73421ab64c2a919 (diff)
downloadtroggle-d3572e18c34c20c661eb61c7f8c46358f7223d37.tar.gz
troggle-d3572e18c34c20c661eb61c7f8c46358f7223d37.tar.bz2
troggle-d3572e18c34c20c661eb61c7f8c46358f7223d37.zip
QM reports all working
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index fa92924..e4ec8b3 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -532,11 +532,7 @@ class LoadingSurvex():
# we would have to create one. But that is not obligatory and no QMs loaded from CSVs have one
# Older troggle/CSV assumes a logbook entry 'found_by' for each QM, with a date.
- # We have a date from the survexfile. This is needed for the absolute_url resolution..
-
- # We don't know if the survexfile has an associated logbook entry as there is no direct link
- # so we create a dummy one anyway. We should make logbook entry links optional in QMs in future and
- # remove this hack.
+ # We don't need this anymore so we don't need to create a placeholder logbook entry.
qmyear = str(survexblock.date)[:4]
blockname = survexblock.name[:7]
logslug = f'D{int(qmyear)}_{blockname}_{int(qm_no):03d}'
@@ -548,27 +544,27 @@ class LoadingSurvex():
place = "oops"
- message = f' ! - logbook dummy "{logslug}" {str(survexblock.date)[:11]} for cave "{caveslug}" created.'
-
- placeholder, hadToCreate = LogbookEntry.objects.get_or_create(date__year=qmyear,
- place=place,
- title="placeholder for survex QM",
- text=message,
- entry_type="DUMMY",
- expedition_id=1,
- defaults={"date": survexblock.date,"cave_slug":caveslug, "slug": logslug})
+ # message = f' ! - logbook dummy "{logslug}" {str(survexblock.date)[:11]} for cave "{caveslug}" created.'
+
+ # placeholder, hadToCreate = LogbookEntry.objects.get_or_create(date__year=qmyear,
+ # place=place,
+ # title="placeholder for survex QM",
+ # text=message,
+ # entry_type="DUMMY",
+ # expedition_id=1,
+ # defaults={"date": survexblock.date,"cave_slug":caveslug, "slug": logslug})
# print(insp+message)
# DataIssue.objects.create(parser='survex', message=message)
try:
qm = QM.objects.create(number=qm_no,
- # nearest_station=a_survex_station_object, # can be null
+ # nearest_station=a_survex_station_object, # can be null
nearest_station_description=qm_resolve_station,
nearest_station_name=qm_nearest,
grade=qm_grade.upper(),
location_description=qm_notes,
blockname = blockname, # only set for survex-imported QMs
- found_by = placeholder,
+ # found_by = placeholder,
expoyear = str(survexblock.date.year),
cave = survexblock.survexfile.cave)
qm.save