diff options
Diffstat (limited to 'parsers/survex.py')
-rw-r--r-- | parsers/survex.py | 28 |
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 |