Better display of wallet names copied from svx files

This commit is contained in:
Philip Sargent
2022-08-24 18:28:15 +03:00
parent 8ca50d8fd4
commit 7e9fd0f353
8 changed files with 22 additions and 8 deletions

View File

@@ -55,12 +55,21 @@ def caveifywallet(w):
'''Gets the cave from the list of survex files,
only selects one of them though. Only used for display.
'''
blocknames = []
blocks = SurvexBlock.objects.filter(scanswallet = w)
for b in blocks:
# NB b.cave is not populated by parser. Use b.survexfile.cave instead, or we could parse b.survexpath
if b.survexfile.cave:
w.cave = b.survexfile.cave # just gets the last one, randomly. SHould make this a list or many:many ideally
if b.name:
blocknames.append(b.name)
if w.name():
w.displaynames = [w.name()]
else:
w.displaynames = blocknames
def fillblankpeople(w):
wp = w.people()
if not wp: # an -empty list