forked from expo/troggle
QM report pages now not crashing, working..
This commit is contained in:
@@ -32,6 +32,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
if cave=='204-steinBH':
|
||||
try:
|
||||
steinBr=Cave.objects.get(official_name="Steinbrückenhöhle")
|
||||
caveid = steinBr
|
||||
except Cave.DoesNotExist:
|
||||
message = f' ! - {qmPath} Steinbruckenhoehle is not in the database. Please run cave parser'
|
||||
print(message)
|
||||
@@ -40,6 +41,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
elif cave=='234-Hauch':
|
||||
try:
|
||||
hauchHl=Cave.objects.get(official_name="Hauchhöhle")
|
||||
caveid = hauchHl
|
||||
except Cave.DoesNotExist:
|
||||
message = f' ! - {qmPath} Hauchhoehle is not in the database. Please run cave parser'
|
||||
print(message)
|
||||
@@ -48,6 +50,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
elif cave =='161-KH':
|
||||
try:
|
||||
kh=Cave.objects.get(official_name="Kaninchenhöhle")
|
||||
caveid = kh
|
||||
except Cave.DoesNotExist:
|
||||
message = f' ! - {qmPath} KH is not in the database. Please run cave parser'
|
||||
print(message)
|
||||
@@ -82,6 +85,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
newQM = QM()
|
||||
newQM.found_by=placeholder
|
||||
newQM.number=QMnum
|
||||
newQM.cave = caveid
|
||||
if line[1]=="Dig":
|
||||
newQM.grade="D"
|
||||
else:
|
||||
@@ -120,7 +124,7 @@ def parseCaveQMs(cave,inputFile):
|
||||
continue
|
||||
|
||||
def parse_KH_QMs(kh, inputFile):
|
||||
"""import QMs from the 1623-161 (Kaninchenh<EFBFBD>hle) html pages
|
||||
"""import QMs from the 1623-161 (Kaninchenhohle) html pages, different format
|
||||
"""
|
||||
khQMs=open(os.path.join(settings.EXPOWEB, inputFile),'r')
|
||||
khQMs=khQMs.readlines()
|
||||
@@ -140,6 +144,7 @@ def parse_KH_QMs(kh, inputFile):
|
||||
'number':res['number']
|
||||
}
|
||||
nonLookupArgs={
|
||||
'cave': kh,
|
||||
'grade':res['grade'],
|
||||
'nearest_station_name':res['nearest_station'],
|
||||
'location_description':res['description']
|
||||
|
||||
Reference in New Issue
Block a user