Change hostmeta fetchers relay default to empty string

merge-requests/130/head
Jason Robinson 2018-04-08 20:20:24 +03:00
rodzic 3bf19d2a8b
commit 2c255a68f7
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -15,7 +15,7 @@ defaults = {
'name': '',
'open_signups': False,
'protocols': [],
'relay': False,
'relay': '',
'server_meta': {},
'services': [],
'platform': '',
@ -85,7 +85,7 @@ def parse_nodeinfo2_document(doc, host):
services = sorted(list(set(inbound + outbound)))
result['services'] = services
result['protocols'] = sorted(doc.get('protocols', []))
result['relay'] = doc.get('relay', False)
result['relay'] = doc.get('relay', '')
result['organization']['contact'] = doc.get('organization', {}).get('contact', '')
result['organization']['name'] = doc.get('organization', {}).get('name', '')
result['organization']['account'] = doc.get('organization', {}).get('account', '')

Wyświetl plik

@ -18,7 +18,7 @@ class TestParseNodeInfoDocument:
'name': 'I Like Toast',
'open_signups': True,
'protocols': ["diaspora"],
'relay': False,
'relay': '',
'server_meta': {},
'services': ["tumblr", "twitter"],
'platform': 'diaspora',
@ -59,7 +59,7 @@ class TestParseNodeInfoDocument:
'name': 'I Like Toast',
'open_signups': True,
'protocols': ["diaspora"],
'relay': False,
'relay': '',
'server_meta': {},
'services': ["tumblr", "twitter"],
'platform': 'diaspora',
@ -136,7 +136,7 @@ class TestParseStatisticsJSONDocument:
'name': 'diaspora*',
'open_signups': True,
'protocols': ["diaspora"],
'relay': False,
'relay': '',
'server_meta': {},
'services': [],
'platform': 'diaspora',