mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-29 05:11:52 +00:00
bugfix
This commit is contained in:
parent
d058942084
commit
83bbda7c40
@ -483,7 +483,7 @@ def qm(request,cave_id,qm_id,year,grade=None, blockname=None):
|
|||||||
|
|
||||||
year=int(year)
|
year=int(year)
|
||||||
|
|
||||||
if blockname == '':
|
if blockname == '' or not blockname:
|
||||||
# CSV import QMs, use old technique
|
# CSV import QMs, use old technique
|
||||||
try:
|
try:
|
||||||
c=getCave(cave_id)
|
c=getCave(cave_id)
|
||||||
@ -492,7 +492,7 @@ def qm(request,cave_id,qm_id,year,grade=None, blockname=None):
|
|||||||
return render(request,'qm.html', {'qm': qm})
|
return render(request,'qm.html', {'qm': qm})
|
||||||
except QM.DoesNotExist:
|
except QM.DoesNotExist:
|
||||||
#raise
|
#raise
|
||||||
return render(request,'errors/badslug.html', {'badslug': f'{cave_id=} {year=} {qm_id=} {blockname=}'})
|
return render(request,'errors/badslug.html', {'badslug': f'QM.DoesNotExist blockname is empty string: {cave_id=} {year=} {qm_id=} {grade=} {blockname=}'})
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -513,13 +513,13 @@ def qm(request,cave_id,qm_id,year,grade=None, blockname=None):
|
|||||||
return render(request,'qm.html', {'qm': qm})
|
return render(request,'qm.html', {'qm': qm})
|
||||||
else:
|
else:
|
||||||
#raise
|
#raise
|
||||||
return render(request,'errors/badslug.html', {'badslug': f'{cave_id=} {year=} {qm_id=} {blockname=}'})
|
return render(request,'errors/badslug.html', {'badslug': f'Failed get {cave_id=} {year=} {qm_id=} {grade=} {blockname=}'})
|
||||||
except MultipleObjectsReturned:
|
except MultipleObjectsReturned:
|
||||||
message = f'Multiple QMs with the same cave, year, number, grade AND first 8 chars of the survexblock name. (Could be caused by incomplete databasereset). Fix this in the survex file(s). {cave_id=} {year=} {qm_id=} {blockname=}'
|
message = f'Multiple QMs with the same cave, year, number, grade AND first 8 chars of the survexblock name. (Could be caused by incomplete databasereset). Fix this in the survex file(s). {cave_id=} {year=} {qm_id=} {blockname=}'
|
||||||
return render(request,'errors/generic.html', {'message': message})
|
return render(request,'errors/generic.html', {'message': message})
|
||||||
except QM.DoesNotExist:
|
except QM.DoesNotExist:
|
||||||
#raise
|
#raise
|
||||||
return render(request,'errors/badslug.html', {'badslug': f'{cave_id=} {year=} {qm_id=} {blockname=}'})
|
return render(request,'errors/badslug.html', {'badslug': f'QM.DoesNotExist blockname is not empty string {cave_id=} {year=} {qm_id=} {grade=} {blockname=}'})
|
||||||
|
|
||||||
|
|
||||||
# def get_qms(request, caveslug):
|
# def get_qms(request, caveslug):
|
||||||
|
Loading…
Reference in New Issue
Block a user