software name always lower case #188

This commit is contained in:
rimu 2024-05-21 19:40:46 +12:00
parent 6495169659
commit 0eba0e4b29
2 changed files with 6 additions and 6 deletions

View file

@ -1071,15 +1071,15 @@ def refresh_instance_profile_task(instance_id: int):
if 'type' in instance_json and instance_json['type'] == 'Application': if 'type' in instance_json and instance_json['type'] == 'Application':
# 'name' is unreliable as the admin can change it to anything. todo: find better way # 'name' is unreliable as the admin can change it to anything. todo: find better way
if instance_json['name'].lower() == 'kbin': if instance_json['name'].lower() == 'kbin':
software = 'Kbin' software = 'kbin'
elif instance_json['name'].lower() == 'mbin': elif instance_json['name'].lower() == 'mbin':
software = 'Mbin' software = 'mbin'
elif instance_json['name'].lower() == 'piefed': elif instance_json['name'].lower() == 'piefed':
software = 'PieFed' software = 'piefed'
elif instance_json['name'].lower() == 'system account': elif instance_json['name'].lower() == 'system account':
software = 'Friendica' software = 'friendica'
else: else:
software = 'Lemmy' software = 'lemmy'
instance.inbox = instance_json['inbox'] instance.inbox = instance_json['inbox']
instance.outbox = instance_json['outbox'] instance.outbox = instance_json['outbox']
instance.software = software instance.software = software

View file

@ -199,7 +199,7 @@ def register(app):
if node.status_code == 200: if node.status_code == 200:
node_json = node.json() node_json = node.json()
if 'software' in node_json: if 'software' in node_json:
instance.software = node_json['software']['name'] instance.software = node_json['software']['name'].lower()
instance.version = node_json['software']['version'] instance.version = node_json['software']['version']
instance.failures = 0 instance.failures = 0
instance.dormant = False instance.dormant = False