Check for string type

main
Bob Mottram 2023-04-23 10:18:20 +01:00
parent 0366577e8b
commit 19c6c55b46
1 changed files with 5 additions and 4 deletions

View File

@ -2233,10 +2233,11 @@ def get_buy_links(post_json_object: str, translate: {}, buy_sites: {}) -> {}:
' ' in item['href']: ' ' in item['href']:
continue continue
if item.get('rel'): if item.get('rel'):
if item['rel'] in ('payment', 'donate', 'donation', if isinstance(item['rel'], str):
'buy', 'purchase'): if item['rel'] in ('payment', 'donate', 'donation',
links[item_name] = item['href'] 'buy', 'purchase'):
continue links[item_name] = item['href']
continue
if buy_sites: if buy_sites:
# limited to an allowlist of buying sites # limited to an allowlist of buying sites
for site, buy_domain in buy_sites.items(): for site, buy_domain in buy_sites.items():