Optional location

main
Bob Mottram 2021-07-27 20:23:55 +01:00
parent 82f51299b7
commit f9012cd948
2 changed files with 9 additions and 6 deletions

View File

@ -108,8 +108,9 @@ def _matchSharedItem(searchStrLowerList: [],
"""
for searchSubstr in searchStrLowerList:
searchSubstr = searchSubstr.strip()
if searchSubstr in sharedItem['location'].lower():
return True
if sharedItem.get('location'):
if searchSubstr in sharedItem['location'].lower():
return True
elif searchSubstr in sharedItem['summary'].lower():
return True
elif searchSubstr in sharedItem['displayName'].lower():
@ -143,8 +144,9 @@ def _htmlSearchResultShare(sharedItem: {}, translate: {},
'<b>' + translate['Type'] + ':</b> ' + sharedItem['itemType'] + ' '
sharedItemsForm += \
'<b>' + translate['Category'] + ':</b> ' + sharedItem['category'] + ' '
sharedItemsForm += \
'<b>' + translate['Location'] + ':</b> ' + sharedItem['location']
if sharedItem.get('location'):
sharedItemsForm += \
'<b>' + translate['Location'] + ':</b> ' + sharedItem['location']
if sharedItem.get('itemPrice') and \
sharedItem.get('itemCurrency'):
if isfloat(sharedItem['itemPrice']):

View File

@ -833,8 +833,9 @@ def htmlIndividualShare(actor: str, item: {}, translate: {},
'<b>' + translate['Type'] + ':</b> ' + item['itemType'] + ' '
profileStr += \
'<b>' + translate['Category'] + ':</b> ' + item['category'] + ' '
profileStr += \
'<b>' + translate['Location'] + ':</b> ' + item['location']
if item.get('location'):
profileStr += \
'<b>' + translate['Location'] + ':</b> ' + item['location']
if item.get('itemPrice') and item.get('itemCurrency'):
if isfloat(item['itemPrice']):
if float(item['itemPrice']) > 0: